]> granicus.if.org Git - nethack/commitdiff
region boolean field [trunk only]
authornethack.allison <nethack.allison>
Thu, 30 Dec 2004 15:54:42 +0000 (15:54 +0000)
committernethack.allison <nethack.allison>
Thu, 30 Dec 2004 15:54:42 +0000 (15:54 +0000)
Since the trunk breaks savefile compatibility anyway,
remove some code that was inappropriately loading a boolean
with multiple values in order to preserve savefile compatibility in 3.4.x

[Note: this patch increments EDITLEVEL rendering existing bones
and save files obsolete]

include/patchlevel.h
include/region.h

index 9b888efca66ebd4d039964b419a8136c2a4007af..4a83ec18ed5f6a4c2a502c844a40e922ddb63bc8 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)patchlevel.h       3.4     2004/12/16      */
+/*     SCCS Id: @(#)patchlevel.h       3.4     2004/12/29      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -13,7 +13,7 @@
  * Incrementing EDITLEVEL can be used to force invalidation of old bones
  * and save files.
  */
-#define EDITLEVEL      16
+#define EDITLEVEL      17
 
 #define COPYRIGHT_BANNER_A \
 "NetHack, Copyright 1985-2004"
index e328956b441a8a6a4364b8fc95f425fdb1126648..247817625654078531573ef215831a97aaeaa76a 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)region.h   3.4     2002/10/15      */
+/*     SCCS Id: @(#)region.h   3.4     2004/12/29      */
 /* Copyright (c) 1996 by Jean-Christophe Collet                          */
 /* NetHack may be freely redistributed.  See license for details. */
 
 typedef boolean FDECL((*callback_proc), (genericptr_t, genericptr_t));
 
 /*
- * Overload the old player_inside field with two values, coded in such
- * a way as to retain compatibility with 3.4.0 save and bones files;
- * this relies on the fact that nethack's `boolean' is really stored
- * in a `char' (or bigger type) rather than in a single bit.
- *
- * 3.4.1 save and bones files will be correct.
- * 3.4.0 save files restored under 3.4.1 will be correct.
- * 3.4.0 bones files used with 3.4.1 will continue to have the minor
- *      3.4.0 bug of falsely claiming that the current game's hero is
- *      responsible for the dead former hero's stinking clouds.
+ * player_flags
  */
-#define REG_HERO_INSIDE        1
-#define REG_NOT_HEROS  2
-#define hero_inside(r) ((unsigned)(r)->player_flags & REG_HERO_INSIDE)
-#define heros_fault(r) (!((unsigned)(r)->player_flags & REG_NOT_HEROS))
+#define REG_HERO_INSIDE        0x01
+#define REG_NOT_HEROS  0x02
+#define hero_inside(r) ((r)->player_flags & REG_HERO_INSIDE)
+#define heros_fault(r) (!((r)->player_flags & REG_NOT_HEROS))
 #define set_hero_inside(r)     ((r)->player_flags |= REG_HERO_INSIDE)
 #define clear_hero_inside(r)   ((r)->player_flags &= ~REG_HERO_INSIDE)
 #define set_heros_fault(r)     ((r)->player_flags &= ~REG_NOT_HEROS)
@@ -49,7 +40,7 @@ typedef struct {
   short leave_f;               /* Function to call when the player leaves */
   short inside_f;              /* Function to call every turn if player's
                                   inside */
-  boolean player_flags;        /* (see above) */
+  unsigned int player_flags;   /* (see above) */
   unsigned int* monsters;      /* Monsters currently inside this region */
   short n_monst;               /* Number of monsters inside this region */
   short max_monst;             /* Maximum number of monsters that can be