]> granicus.if.org Git - nethack/commitdiff
stone/unexplored glyph follow-up
authornhmall <nhmall@nethack.org>
Thu, 13 Feb 2020 22:26:39 +0000 (17:26 -0500)
committernhmall <nhmall@nethack.org>
Thu, 13 Feb 2020 22:37:55 +0000 (17:37 -0500)
typo

include/decl.h
src/bones.c
src/decl.c
src/mklev.c
src/read.c
src/save.c

index 37d78675dcd2cab30012a1b10a33f899bef9fd6d..335eaec92caebdc8b518c48baae5c37848fc5ccb 100644 (file)
@@ -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;
index d7341a86947ad5993e013ac2f15ce6e53e5d0c49..50e3b2b3e098f67028d54af82e4af61051b5d045 100644 (file)
@@ -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;
         }
 
index 91b922f7997f2e11e423e50d31e3793950b0ea44..6bf82e986b4025590ca1d2a862719482142bfc5f 100644 (file)
@@ -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))
index 505a8996862870cb9577187654d677543b809f57..85127f6cc36465bc5d2dd0d971a2ad2e46f81f7e 100644 (file)
@@ -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,
index 1b909a5bf52e1c983eac6e717e14bc8ed26ce9d9..544a12874f098af792609cd149daadcbbc99ca69 100644 (file)
@@ -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 */
index 4ed4bcde03a6de6c0e9486a295f4c788f6d57b93..a026fc17262829f5d78dd511932005e4985546e9 100644 (file)
@@ -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;