]> granicus.if.org Git - nethack/commitdiff
u.utraptype, TT_BEARTRAP
authorPatR <rankin@nethack.org>
Wed, 27 Apr 2022 18:04:12 +0000 (11:04 -0700)
committerPatR <rankin@nethack.org>
Wed, 27 Apr 2022 18:04:12 +0000 (11:04 -0700)
Add 'FIXME' fix by entrez to change TT_BEARTRAP to non-zero.

Increments EDITLEVEL, invalidating existing save and bones files.

doc/fixes3-7-0.txt
include/patchlevel.h
include/you.h
src/hack.c
src/trap.c

index 03bd60722f2c0d3a405a8433a49964bbe9880236..b708a4fb569ffe372bf4dd4a349df085e739a261 100644 (file)
@@ -1858,3 +1858,5 @@ remove obsolete roles[].femalenum and rename roles[].malenum to roles[].mnum;
        likewise for races[]
 add git submodule support to the Makefiles by specifying git=1 or GIT=1 on the
        make command
+add TT_NONE==0, renumber other u.utraptype values so that TT_BEARTRAP isn't 0
+
index 142366ae7f3a40bb0c64c4d0819e81cccf42c33d..d090797aec5d12edf43e16d527d1ceee31778df4 100644 (file)
@@ -17,7 +17,7 @@
  * Incrementing EDITLEVEL can be used to force invalidation of old bones
  * and save files.
  */
-#define EDITLEVEL 53
+#define EDITLEVEL 54
 
 /*
  * Development status possibilities.
index b088fedb358ebe81d14213ec31b940d74232fc5e..1062b43bb7ddc363bb8c9bdcea8aa094e7e6cba8 100644 (file)
@@ -327,12 +327,13 @@ struct Align {
 extern const struct Align aligns[]; /* table of available alignments */
 
 enum utraptypes {
-    TT_BEARTRAP   = 0,
-    TT_PIT        = 1,
-    TT_WEB        = 2,
-    TT_LAVA       = 3,
-    TT_INFLOOR    = 4,
-    TT_BURIEDBALL = 5
+    TT_NONE       = 0,
+    TT_BEARTRAP   = 1,
+    TT_PIT        = 2,
+    TT_WEB        = 3,
+    TT_LAVA       = 4,
+    TT_INFLOOR    = 5,
+    TT_BURIEDBALL = 6
 };
 
 enum utotypes {
index e10c2a14433e5ee63ec4e27854ce5290bc673f28..5d72ddb51763a4348b1a230450716408b086297a 100644 (file)
@@ -1510,6 +1510,9 @@ trapmove(int x, int y,       /* targetted destination, <u.ux+u.dx,u.uy+u.dy> */
                 buried_ball_to_punishment();
         }
         break;
+    case TT_NONE:
+        impossible("trapmove: trapped in nothing?");
+        break;
     default:
         impossible("trapmove: stuck in unknown trap? (%d)",
                    (int) u.utraptype);
index e49e4b5a6c390fac7243726dbc0978f1be351d7e..a4e783727e738caa0106fa22570c8cfb2b5ad150 100644 (file)
@@ -902,12 +902,7 @@ set_utrap(unsigned int tim, unsigned int typ)
         g.context.botl = TRUE;
 
     u.utrap = tim;
-    /* FIXME:
-     * utraptype==0 is bear trap rather than 'none'; we probably ought
-     * to change that but can't do so until save file compatability is
-     * able to be broken.
-     */
-    u.utraptype = tim ? typ : 0;
+    u.utraptype = tim ? typ : TT_NONE;
 
     float_vs_flight(); /* maybe block Lev and/or Fly */
 }