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;
/* 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;
}
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))
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;
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,
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 */
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;