OSDN Git Service

fix #48255
[jnethack/source.git] / src / decl.c
index 84d9437..5c97a6b 100644 (file)
@@ -1,5 +1,6 @@
-/* NetHack 3.6 decl.c  $NHDT-Date: 1446975463 2015/11/08 09:37:43 $  $NHDT-Branch: master $:$NHDT-Revision: 1.62 $ */
+/* NetHack 3.6 decl.c  $NHDT-Date: 1573869062 2019/11/16 01:51:02 $  $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.149 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
+/*-Copyright (c) Michael Allison, 2009. */
 /* NetHack may be freely redistributed.  See license for details. */
 
 #include "hack.h"
@@ -16,6 +17,7 @@ int locknum = 0; /* max num of simultaneous users */
 #ifdef DEF_PAGER
 char *catmore = 0; /* default pager */
 #endif
+char chosen_windowtype[WINTYPELEN];
 
 NEARDATA int bases[MAXOCLASSES] = DUMMY;
 
@@ -56,6 +58,7 @@ NEARDATA char pl_fruit[PL_FSIZ] = DUMMY;
 NEARDATA struct fruit *ffruit = (struct fruit *) 0;
 
 NEARDATA char tune[6] = DUMMY;
+NEARDATA boolean ransacked = 0;
 
 const char *occtxt = DUMMY;
 const char quitchars[] = " \r\n\033";
@@ -117,6 +120,7 @@ NEARDATA boolean mrg_to_wielded = FALSE;
 /* weapon picked is merged with wielded one */
 
 NEARDATA boolean in_steed_dismounting = FALSE;
+NEARDATA boolean has_strong_rngseed = FALSE;
 
 NEARDATA coord bhitpos = DUMMY;
 NEARDATA coord doors[DOORMAX] = { DUMMY };
@@ -164,6 +168,7 @@ NEARDATA struct obj
 #ifdef TEXTCOLOR
 /*
  *  This must be the same order as used for buzz() in zap.c.
+ *  (They're only used in mapglyph.c so probably shouldn't be here.)
  */
 const int zapcolors[NUM_ZAP] = {
     HI_ZAP,     /* 0 - missile */
@@ -172,8 +177,10 @@ const int zapcolors[NUM_ZAP] = {
     HI_ZAP,     /* 3 - sleep */
     CLR_BLACK,  /* 4 - death */
     CLR_WHITE,  /* 5 - lightning */
-    CLR_YELLOW, /* 6 - poison gas */
-    CLR_GREEN,  /* 7 - acid */
+    /* 3.6.3: poison gas zap used to be yellow and acid zap was green,
+       which conflicted with the corresponding dragon colors */
+    CLR_GREEN,  /* 6 - poison gas */
+    CLR_YELLOW, /* 7 - acid */
 };
 #endif /* text color */
 
@@ -194,10 +201,11 @@ NEARDATA struct obj *migrating_objs = (struct obj *) 0;
 /* objects not yet paid for */
 NEARDATA struct obj *billobjs = (struct obj *) 0;
 
-/* used to zero all elements of a struct obj */
-NEARDATA struct obj zeroobj = DUMMY;
+/* used to zero all elements of a struct obj and a struct monst */
+NEARDATA const struct obj zeroobj = DUMMY;
+NEARDATA const struct monst zeromonst = DUMMY;
 /* used to zero out union any; initializer deliberately omitted */
-NEARDATA anything zeroany;
+NEARDATA const anything zeroany;
 
 /* originally from dog.c */
 NEARDATA char dogname[PL_PSIZ] = DUMMY;
@@ -208,10 +216,14 @@ char preferred_pet; /* '\0', 'c', 'd', 'n' (none) */
 NEARDATA struct monst *mydogs = (struct monst *) 0;
 /* monsters that are moving to another dungeon level */
 NEARDATA struct monst *migrating_mons = (struct monst *) 0;
+NEARDATA struct autopickup_exception *apelist =
+                            (struct autopickup_exception *)0;
 
 NEARDATA struct mvitals mvitals[NUMMONS];
+NEARDATA long domove_attempting = 0L;
+NEARDATA long domove_succeeded = 0L;
 
-#if 0 /*JP*/
+#if 0 /*JP:T*/
 NEARDATA struct c_color_names c_color_names = {
     "black",  "amber", "golden", "light blue", "red",   "green",
     "silver", "blue",  "purple", "white",      "orange"
@@ -226,7 +238,7 @@ NEARDATA struct c_color_names c_color_names = {
 struct menucoloring *menu_colorings = NULL;
 
 const char *c_obj_colors[] = {
-#if 0 /*JP*/
+#if 0 /*JP:T*/
     "black",          /* CLR_BLACK */
     "red",            /* CLR_RED */
     "green",          /* CLR_GREEN */
@@ -263,7 +275,7 @@ const char *c_obj_colors[] = {
 #endif
 };
 
-#if 0 /*JP*/
+#if 0 /*JP:T*/
 struct c_common_strings c_common_strings = { "Nothing happens.",
                                              "That's enough tries!",
                                              "That is a silly thing to %s.",
@@ -273,7 +285,8 @@ struct c_common_strings c_common_strings = { "Nothing happens.",
                                              "You can move again.",
                                              "Never mind.",
                                              "vision quickly clears.",
-                                             { "the", "your" } };
+                                             { "the", "your" },
+                                             { "mon", "you" } };
 #else
 struct c_common_strings c_common_strings = { "\89½\82à\8bN\82«\82È\82©\82Á\82½\81D",
                                              "\82¢\82¢\89Á\8c¸\82É\82µ\82ë\81I",
@@ -284,12 +297,13 @@ struct c_common_strings c_common_strings = { "
                                              "\82Ü\82½\93®\82¯\82é\82æ\82¤\82É\82È\82Á\82½\81D",
                                              "\82¦\81H",
                                              "\8e\8b\8aE\82ª\82Í\82Á\82«\82è\82µ\82½\81D",
-                                             { "", "\82 \82È\82½\82Ì" } };
+                                             { "", "\82 \82È\82½\82Ì" },
+                                             { "mon", "you" } };
 #endif
 
 /* NOTE: the order of these words exactly corresponds to the
    order of oc_material values #define'd in objclass.h. */
-#if 0 /*JP*/
+#if 0 /*JP:T*/
 const char *materialnm[] = { "mysterious", "liquid",  "wax",        "organic",
                              "flesh",      "paper",   "cloth",      "leather",
                              "wooden",     "bone",    "dragonhide", "iron",
@@ -311,9 +325,7 @@ NEARDATA char **viz_array = 0; /* used in cansee() and couldsee() macros */
 
 /* Global windowing data, defined here for multi-window-system support */
 NEARDATA winid WIN_MESSAGE = WIN_ERR;
-#ifndef STATUS_VIA_WINDOWPORT
 NEARDATA winid WIN_STATUS = WIN_ERR;
-#endif
 NEARDATA winid WIN_MAP = WIN_ERR, WIN_INVEN = WIN_ERR;
 char toplines[TBUFSZ];
 /* Windowing stuff that's really tty oriented, but present for all ports */
@@ -323,9 +335,15 @@ char *fqn_prefix[PREFIX_COUNT] = { (char *) 0, (char *) 0, (char *) 0,
                                    (char *) 0, (char *) 0, (char *) 0,
                                    (char *) 0, (char *) 0, (char *) 0,
                                    (char *) 0 };
+#ifdef WIN32
+boolean fqn_prefix_locked[PREFIX_COUNT] = { FALSE, FALSE, FALSE,
+                                            FALSE, FALSE, FALSE,
+                                            FALSE, FALSE, FALSE,
+                                            FALSE };
+#endif
 
 #ifdef PREFIXES_IN_USE
-char *fqn_prefix_names[PREFIX_COUNT] = {
+const char *fqn_prefix_names[PREFIX_COUNT] = {
     "hackdir",  "leveldir", "savedir",    "bonesdir",  "datadir",
     "scoredir", "lockdir",  "sysconfdir", "configdir", "troubledir"
 };
@@ -380,7 +398,7 @@ NEARDATA struct savefile_info sfrestinfo, sfsaveinfo = {
 struct plinemsg_type *plinemsg_types = (struct plinemsg_type *) 0;
 
 #ifdef PANICTRACE
-char *ARGV0;
+const char *ARGV0;
 #endif
 
 /* support for lint.h */