diff --git a/include/decl.h b/include/decl.h index 37d78675d..335eaec92 100644 --- a/include/decl.h +++ b/include/decl.h @@ -1199,7 +1199,6 @@ struct const_globals { const struct obj zeroobj; /* used to zero out a struct obj */ const struct monst zeromonst; /* used to zero out a struct monst */ const anything zeroany; /* used to zero out union any */ - const struct rm zerorm; /* used to zero out struct rm */ }; E const struct const_globals cg; diff --git a/src/bones.c b/src/bones.c index d7341a869..50e3b2b3e 100644 --- a/src/bones.c +++ b/src/bones.c @@ -482,7 +482,9 @@ struct obj *corpse; /* Clear all memory from the level. */ for (x = 1; x < COLNO; x++) for (y = 0; y < ROWNO; y++) { - levl[x][y] = cg.zerorm; + levl[x][y].seenv = 0; + levl[x][y].waslit = 0; + levl[x][y].glyph = GLYPH_UNEXPLORED; g.lastseentyp[x][y] = 0; } diff --git a/src/decl.c b/src/decl.c index 91b922f79..6bf82e986 100644 --- a/src/decl.c +++ b/src/decl.c @@ -699,7 +699,6 @@ const struct const_globals cg = { DUMMY, /* zeroobj */ DUMMY, /* zeromonst */ DUMMY, /* zeroany */ - { GLYPH_UNEXPLORED, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, }; #define ZERO(x) memset(&x, 0, sizeof(x)) diff --git a/src/mklev.c b/src/mklev.c index 505a89968..85127f6cc 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -585,6 +585,8 @@ makevtele() void clear_level_structures() { + static struct rm zerorm = { GLYPH_UNEXPLORED, + 0, 0, 0, 0, 0, 0, 0, 0, 0 }; register int x, y; register struct rm *lev; @@ -595,7 +597,7 @@ clear_level_structures() for (x = 0; x < COLNO; x++) { lev = &levl[x][0]; for (y = 0; y < ROWNO; y++) { - *lev++ = cg.zerorm; + *lev++ = zerorm; /* * These used to be '#if MICROPORT_BUG', * with use of memset(0) for '#if !MICROPORT_BUG' below, diff --git a/src/read.c b/src/read.c index 1b909a5bf..544a12874 100644 --- a/src/read.c +++ b/src/read.c @@ -804,7 +804,9 @@ int howmuch; for (zy = 0; zy < ROWNO; zy++) if (howmuch & ALL_MAP || rn2(7)) { /* Zonk all memory of this location. */ - levl[zx][zy] = cg.zerorm; + levl[zx][zy].seenv = 0; + levl[zx][zy].waslit = 0; + levl[zx][zy].glyph = GLYPH_UNEXPLORED; g.lastseentyp[zx][zy] = STONE; } /* forget overview data for this level */ diff --git a/src/save.c b/src/save.c index 4ed4bcde0..a026fc172 100644 --- a/src/save.c +++ b/src/save.c @@ -579,7 +579,8 @@ xchar lev; for (x = 0; x < COLNO; x++) { g.level.monsters[x][y] = 0; g.level.objects[x][y] = 0; - levl[x][y] = cg.zerorm; + levl[x][y].seenv = 0; + levl[x][y].glyph = GLYPH_UNEXPLORED; } fmon = 0; g.ftrap = 0;