]> granicus.if.org Git - nethack/commitdiff
Previous encumberance state moved to decl.c.
authorBart House <bart@barthouse.com>
Thu, 22 Nov 2018 23:40:31 +0000 (15:40 -0800)
committerBart House <bart@barthouse.com>
Thu, 22 Nov 2018 23:40:31 +0000 (15:40 -0800)
include/decl.h
src/decl.c
src/pickup.c

index 992e86ad58cca80de823f12899895dfd52a2438d..7fcde0c6c188afeb0768845e86f06f65ceb1772f 100644 (file)
@@ -437,6 +437,9 @@ struct early_opt {
     boolean valallowed;
 };
 
+/* encumbrance */
+E int oldcap;
+
 #undef E
 
 #endif /* DECL_H */
index 6c26b442219b594083a04844ce5932cc81a6250d..c3397a048e7585c19a675aaf7fffb01981e1cc8c 100644 (file)
@@ -214,6 +214,9 @@ NEARDATA struct monst *migrating_mons = (struct monst *) 0;
 
 NEARDATA struct mvitals mvitals[NUMMONS];
 
+/* originally from pickup.c */
+int oldcap = 0; /* encumbrance */
+
 NEARDATA struct c_color_names c_color_names = {
     "black",  "amber", "golden", "light blue", "red",   "green",
     "silver", "blue",  "purple", "white",      "orange"
@@ -525,6 +528,8 @@ decl_early_init()
     ZERO(ubirthday);
     ZERO(urealtime);
 
+    ZERO(oldcap);
+
     ZEROARRAY(lastseentyp);
 
     ZEROPTR(invent);
index d68def38d7026a56e3e08f30954f060a2605b285..b32640dbd8c5910b6cee19f6849f9ddecd035a79 100644 (file)
@@ -1556,7 +1556,6 @@ struct obj *otmp;
 int
 encumber_msg()
 {
-    static int oldcap = UNENCUMBERED;
     int newcap = near_capacity();
 
     if (oldcap < newcap) {