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:
parent
b100b40846
commit
ed27d7a24f
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue