]> granicus.if.org Git - nethack/commitdiff
trunk only: preserving context (include files)
authornethack.allison <nethack.allison>
Sun, 21 Sep 2003 11:46:53 +0000 (11:46 +0000)
committernethack.allison <nethack.allison>
Sun, 21 Sep 2003 11:46:53 +0000 (11:46 +0000)
Pat Rankin wrote:
> collect them all into some new struct and
> save that separately rather than jamming more non-option stuff
> into struct flags.

This patch:
- collects all context/tracking related fields from flags
  into a new structure called "context."
It also adds the following to the new structure:
- stethoscope turn support
- victual support
- tin support

include/decl.h
include/display.h
include/flag.h
include/hack.h
include/patchlevel.h

index 178a9b1280089abedb565748127edfcbba6fe641..d1d4ddd2051e777b7ae237cfe9327a8ab224aec3 100644 (file)
@@ -198,14 +198,6 @@ E NEARDATA schar tbx, tby;         /* set in mthrowu.c */
 
 E NEARDATA struct multishot { int n, i; short o; boolean s; } m_shot;
 
-E NEARDATA struct dig_info {           /* apply.c, hack.c */
-       int     effort;
-       d_level level;
-       coord   pos;
-       long lastdigtime;
-       boolean down, chew, warned, quiet;
-} digging;
-
 E NEARDATA long moves, monstermoves;
 E NEARDATA long wailmsg;
 
index 52eb71faa9fc787d3a970c361be1b8584d5d748a..a6e7bd7232dd5e37f7609e10d4280df559f5c100 100644 (file)
@@ -42,7 +42,7 @@
 
 #define mon_warning(mon) (Warning && !(mon)->mpeaceful &&                              \
                         (distu((mon)->mx, (mon)->my) < 100) &&                         \
-                        (((int) ((mon)->m_lev / 4)) >= flags.warnlevel))
+                        (((int) ((mon)->m_lev / 4)) >= context.warnlevel))
 
 /*
  * mon_visible()
index 4148de389ac46484beaed38813346d5180acca7f..aac56d65f1deefad9ef549942cfd8b03694f03a5 100644 (file)
@@ -28,8 +28,6 @@ struct flag {
 #ifdef MAIL
        boolean  biff;          /* enable checking for mail */
 #endif
-       boolean  botl;          /* partially redo status line */
-       boolean  botlx;         /* print an entirely new bottom line */
        boolean  confirm;       /* confirm before hitting tame monsters */
        boolean  debug;         /* in debugging mode */
 #define wizard  flags.debug
@@ -40,8 +38,7 @@ struct flag {
 #endif
 #define discover flags.explore
        boolean  female;
-       boolean  forcefight;
-       boolean  friday13;      /* it's Friday the 13th */
+       boolean  friday13;      /* it's Friday the 13th */
        boolean  help;          /* look in data file for info about stuff */
        boolean  ignintr;       /* ignore interrupts */
 #ifdef INSURANCE
@@ -50,13 +47,7 @@ struct flag {
        boolean  invlet_constant; /* let objects keep their inventory symbol */
        boolean  legacy;        /* print game entry "story" */
        boolean  lit_corridor;  /* show a dark corr as lit if it is in sight */
-       boolean  made_amulet;
-       boolean  mon_moving;    /* monsters' turn to move */
-       boolean  move;
-       boolean  mv;
-       boolean  bypasses;      /* bypass flag is set on at least one fobj */
        boolean  nap;           /* `timed_delay' option for display effects */
-       boolean  nopick;        /* do not pickup objects (as when running) */
        boolean  null;          /* OK to send nulls to the terminal */
 #ifdef MAC
        boolean  page_wait;     /* put up a --More-- after a page of messages */
@@ -84,19 +75,10 @@ struct flag {
        boolean  verbose;       /* max battle info */
        boolean  prayconfirm;   /* confirm before praying */
        int      end_top, end_around;   /* describe desired score list */
-       unsigned ident;         /* social security number for each monster */
        unsigned moonphase;
        unsigned long suppress_alert;
 #define NEW_MOON       0
 #define FULL_MOON      4
-       unsigned no_of_wizards; /* 0, 1 or 2 (wizard and his shadow) */
-       boolean  travel;        /* find way automatically to u.tx,u.ty */
-       unsigned run;           /* 0: h (etc), 1: H (etc), 2: fh (etc) */
-                               /* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
-                               /* 8: travel */
-       unsigned long warntype; /* warn_of_mon monster type M2 */
-       int      warnlevel;
-       int      djinni_count, ghost_count;     /* potion effect tuning */
        int      pickup_burden;         /* maximum burden before prompt */
        char     inv_order[MAXOCLASSES];
        char     pickup_types[MAXOCLASSES];
index 469664e16c6d3d295846409269c3c98411c81198..38742adf647f482357bd384bbf5a3418b2ee9128 100644 (file)
@@ -88,6 +88,7 @@
 #include "objclass.h"
 #include "youprop.h"
 #include "wintype.h"
+#include "context.h"
 #include "decl.h"
 #include "timeout.h"
 
@@ -100,8 +101,8 @@ NEARDATA extern coord bhitpos;      /* place where throw or zap hits or stops */
 #define FLASHED_LIGHT  3
 #define INVIS_BEAM     4
 
-#define MATCH_WARN_OF_MON(mon)  (Warn_of_mon && flags.warntype && \
-                                (flags.warntype & (mon)->data->mflags2))
+#define MATCH_WARN_OF_MON(mon)  (Warn_of_mon && context.warntype && \
+                                (context.warntype & (mon)->data->mflags2))
 
 #include "trap.h"
 #include "flag.h"
index 2d76a452aee51ddff13a3b2dc7ef0dd46bdeef5b..cfcb4c21b49c7a53729a4523278210fd6630c49c 100644 (file)
@@ -13,7 +13,7 @@
  * Incrementing EDITLEVEL can be used to force invalidation of old bones
  * and save files.
  */
-#define EDITLEVEL      1
+#define EDITLEVEL      2
 
 #define COPYRIGHT_BANNER_A \
 "NetHack, Copyright 1985-2003"
@@ -34,7 +34,7 @@
  * PP = patch level, ee = edit level, L = literal suffix "L",
  * with all four numbers specified as two hexadecimal digits.
  */
-#define VERSION_COMPATIBILITY 0x03040100L
+#define VERSION_COMPATIBILITY 0x03040200L
 #endif
 
 /*****************************************************************************/