From 74b834c77414f648fd37ecfd512636c529717326 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Sun, 21 Sep 2003 11:46:53 +0000 Subject: [PATCH] trunk only: preserving context (include files) 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 | 8 -------- include/display.h | 2 +- include/flag.h | 20 +------------------- include/hack.h | 5 +++-- include/patchlevel.h | 4 ++-- 5 files changed, 7 insertions(+), 32 deletions(-) diff --git a/include/decl.h b/include/decl.h index 178a9b128..d1d4ddd20 100644 --- a/include/decl.h +++ b/include/decl.h @@ -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; diff --git a/include/display.h b/include/display.h index 52eb71faa..a6e7bd723 100644 --- a/include/display.h +++ b/include/display.h @@ -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() diff --git a/include/flag.h b/include/flag.h index 4148de389..aac56d65f 100644 --- a/include/flag.h +++ b/include/flag.h @@ -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]; diff --git a/include/hack.h b/include/hack.h index 469664e16..38742adf6 100644 --- a/include/hack.h +++ b/include/hack.h @@ -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" diff --git a/include/patchlevel.h b/include/patchlevel.h index 2d76a452a..cfcb4c21b 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -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 /*****************************************************************************/ -- 2.40.0