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.
This commit is contained in:
John "Elwin" Edwards 2017-02-08 19:50:36 -05:00
parent b100b40846
commit ed27d7a24f

View file

@ -350,7 +350,7 @@ ur_write_room(FILE *savef, struct room *r)
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 @@ ur_read_room(FILE *savef)
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);
}