diff --git a/src/save.c b/src/save.c
index a219fdf234bccbcd40c189b3d4cae54b40b1d763..1fc44415cf329780581292c7d95eb48c66b2df72 100644 (file)
--- a/src/save.c
+++ b/src/save.c
}
static void G_savegame (Stream *h) {
+ int i = 0;
stream_write8(_2pl, h);
stream_write8(g_dm, h);
stream_write8(g_exit, h);
stream_write32(dm_pl1p, h);
stream_write32(dm_pl2p, h);
stream_write32(dm_pnum, h);
- int i = 0;
while (i < dm_pnum) {
stream_write32(dm_pos[i].x, h);
stream_write32(dm_pos[i].y, h);
}
static void G_loadgame (Stream *h) {
+ int i = 0;
_2pl = stream_read8(h);
g_dm = stream_read8(h);
g_exit = stream_read8(h);
dm_pl1p = stream_read32(h);
dm_pl2p = stream_read32(h);
dm_pnum = stream_read32(h);
- int i = 0;
while (i < dm_pnum) {
dm_pos[i].x = stream_read32(h);
dm_pos[i].y = stream_read32(h);
}
int SAVE_getname (Stream *r, char name[24]) {
+ int16_t version;
stream_read(name, 24, 1, r);
- int16_t version = stream_read16(r);
+ version = stream_read16(r);
return version == 3;
}