From: PatR Date: Wed, 27 Apr 2022 18:04:12 +0000 (-0700) Subject: u.utraptype, TT_BEARTRAP X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d194459c7df4c9ff31372c7cb8aea7628aa24181;p=nethack u.utraptype, TT_BEARTRAP Add 'FIXME' fix by entrez to change TT_BEARTRAP to non-zero. Increments EDITLEVEL, invalidating existing save and bones files. --- diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 03bd60722..b708a4fb5 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -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 + diff --git a/include/patchlevel.h b/include/patchlevel.h index 142366ae7..d090797ae 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -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. diff --git a/include/you.h b/include/you.h index b088fedb3..1062b43bb 100644 --- a/include/you.h +++ b/include/you.h @@ -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 { diff --git a/src/hack.c b/src/hack.c index e10c2a144..5d72ddb51 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1510,6 +1510,9 @@ trapmove(int x, int y, /* targetted destination, */ 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); diff --git a/src/trap.c b/src/trap.c index e49e4b5a6..a4e783727 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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 */ }