# HG changeset patch # User John "Elwin" Edwards # Date 1486601436 18000 # Node ID 2908dc47f9e21e8ccda384d6715887786687eebc # Parent c4b12d2d1dcd0167feb0893edd708fffacc647ac UltraRogue: fix crash when restoring. The r_flags field in struct room was being written as an int and read as a short. This caused the restore functions to receive the wrong data, usually an impossible string length, and abort. This breaks save compatibility, though the save files had problems anyway: the r_fires field should have been used, instead of reading and writing r_flags twice. diff -r c4b12d2d1dcd -r 2908dc47f9e2 urogue/state.c --- a/urogue/state.c Tue Jan 31 20:33:49 2017 -0500 +++ b/urogue/state.c Wed Feb 08 19:50:36 2017 -0500 @@ -350,7 +350,7 @@ ur_write_int(savef, r->r_flags); ur_write_int(savef, r->r_nexits); - ur_write_int(savef, r->r_flags); + ur_write_short(savef, r->r_fires); } struct room * @@ -369,7 +369,7 @@ r->r_flags = ur_read_int(savef); r->r_nexits = ur_read_int(savef); - r->r_flags = ur_read_short(savef); + r->r_fires = ur_read_short(savef); return(r); }