* Incrementing EDITLEVEL can be used to force invalidation of old bones
* and save files.
*/
-#define EDITLEVEL 43
+#define EDITLEVEL 44
#define COPYRIGHT_BANNER_A \
"NetHack, Copyright 1985-2009"
* The structure describing a coordinate position.
* Before adding fields, remember that this will significantly affect
* the size of temporary files and save files.
+ *
+ * Also remember that the run-length encoding for some ports in save.c
+ * must be updated to consider the field.
*/
struct rm {
int glyph; /* what the hero thinks is there */
Bitfield(roomno,6); /* room # for special rooms */
Bitfield(edge,1); /* marks boundaries for special rooms*/
Bitfield(candig,1); /* Exception to Can_dig_down; was a trapdoor */
-
-#ifdef DUNGEON_OVERVIEW
- Bitfield(styp, 6); /* last seen/touched dungeon typ */
- /* 2 free bits */
-#endif /* DUNGEON_OVERVIEW */
};
/*
}
dlevel_t;
+#ifdef DUNGEON_OVERVIEW
+extern schar lastseentyp[COLNO][ROWNO]; /* last seen/touched dungeon typ */
+#endif /* DUNGEON_OVERVIEW */
+
extern dlevel_t level; /* structure describing the current level */
/*
levl[x][y].waslit = 0;
levl[x][y].glyph = cmap_to_glyph(S_stone);
#ifdef DUNGEON_OVERVIEW
- levl[x][y].styp = 0;
+ lastseentyp[x][y] = 0;
#endif
}
NEARDATA struct you u = DUMMY;
NEARDATA time_t ubirthday = DUMMY;
+
+#ifdef DUNGEON_OVERVIEW
+schar lastseentyp[COLNO][ROWNO] = {DUMMY}; /* last seen/touched dungeon typ */
+#endif /* DUNGEON_OVERVIEW */
+
NEARDATA struct obj *invent = (struct obj *)0,
*uwep = (struct obj *)0, *uarm = (struct obj *)0,
*uswapwep = (struct obj *)0,
STATIC_DCL int FDECL(wall_angle, (struct rm *));
#ifdef DUNGEON_OVERVIEW
-# define remember_topology(levp) ((levp)->styp = (levp)->typ)
+# define remember_topology(x,y) (lastseentyp[x][y] = levl[x][y].typ)
#else
# define remember_topology(levp) /*empty*/
#endif
lev->glyph = glyph;
if (show) show_glyph(x,y, glyph);
- remember_topology(lev); /* DUNGEON_OVERVIEW */
+ remember_topology(x,y); /* DUNGEON_OVERVIEW */
}
/*
else \
map_background(x,y,show); \
\
- remember_topology(&levl[x][y]); /* DUNGEON_OVERVIEW */ \
+ remember_topology(x,y); /* DUNGEON_OVERVIEW */ \
}
void
* (vision-related styp update done in loop below)
*/
if (!Levitation)
- levl[u.ux][u.uy].styp = levl[u.ux][u.uy].typ;
+ lastseentyp[u.ux][u.uy] = levl[u.ux][u.uy].typ;
for (x = 0; x < COLNO; x++) {
for (y = 0; y < ROWNO; y++) {
/* update styp from viz_array */
if (viz_array[y][x] & IN_SIGHT)
- levl[x][y].styp = levl[x][y].typ;
+ lastseentyp[x][y] = levl[x][y].typ;
- switch (levl[x][y].styp) {
+ switch (lastseentyp[x][y]) {
/*
case ICE:
mptr->feat.ice = 1;
if (Blind) {
int oldglyph = door->glyph;
#ifdef DUNGEON_OVERVIEW
- schar oldstyp = door->styp;
+ schar oldlastseentyp = lastseentyp[cc.x][cc.y];
#endif
feel_location(cc.x, cc.y);
if (door->glyph != oldglyph
#ifdef DUNGEON_OVERVIEW
- || door->styp != oldstyp
+ || lastseentyp[cc.x][cc.y] != oldlastseentyp
#endif
) res = 1; /* learned something */
}
if (Blind) {
int oldglyph = door->glyph;
#ifdef DUNGEON_OVERVIEW
- schar oldstyp = door->styp;
+ schar oldlastseentyp = lastseentyp[x][y];
#endif
feel_location(x, y);
if (door->glyph != oldglyph
#ifdef DUNGEON_OVERVIEW
- || door->styp != oldstyp
+ || lastseentyp[x][y] != oldlastseentyp
#endif
) res = 1; /* learned something */
}
levl[zx][zy].waslit = 0;
levl[zx][zy].glyph = cmap_to_glyph(S_stone);
#ifdef DUNGEON_OVERVIEW
- levl[zx][zy].styp = STONE;
+ lastseentyp[zx][zy] = STONE;
#endif
}
}
trickery(trickbuf);
}
rest_levl(fd, (boolean)((sfrestinfo.sfi1 & SFI1_RLECOMP) == SFI1_RLECOMP));
+#ifdef DUNGEON_OVERVIEW
+ mread(fd, (genericptr_t)lastseentyp, sizeof(lastseentyp));
+#endif
mread(fd, (genericptr_t)&omoves, sizeof(omoves));
elapsed = monstermoves - omoves;
mread(fd, (genericptr_t)&upstair, sizeof(stairway));
bwrite(fd,(genericptr_t) &lev,sizeof(lev));
#endif
savelevl(fd, (boolean)((sfsaveinfo.sfi1 & SFI1_RLECOMP) == SFI1_RLECOMP));
-
+#ifdef DUNGEON_OVERVIEW
+ bwrite(fd,(genericptr_t) lastseentyp,sizeof(lastseentyp));
+#endif
bwrite(fd,(genericptr_t) &monstermoves,sizeof(monstermoves));
bwrite(fd,(genericptr_t) &upstair,sizeof(stairway));
bwrite(fd,(genericptr_t) &dnstair,sizeof(stairway));
&& prm->lit == rgrm->lit
&& prm->waslit == rgrm->waslit
&& prm->roomno == rgrm->roomno
- && prm->edge == rgrm->edge) {
+ && prm->edge == rgrm->edge
+ && prm->candig == rgrm->candig) {
match++;
if (match > 254) {
match = 254; /* undo this match */