]> granicus.if.org Git - nethack/commitdiff
Removed unnecessary use of static for nocreate values.
authorBart House <bart@barthouse.com>
Thu, 22 Nov 2018 18:15:43 +0000 (10:15 -0800)
committerBart House <bart@barthouse.com>
Thu, 22 Nov 2018 20:49:10 +0000 (12:49 -0800)
If multiple games are played without exiting the process, on the second
new player creation the nocreate values will already be set based
on the first player creation.

src/u_init.c

index 5b5c5113f84f37eaf33324742ecb00bee05f115d..71da5a84aa2d276532aa888fe9a28765b2a03ca4 100644 (file)
@@ -974,15 +974,16 @@ register struct trobj *trop;
     struct obj *obj;
     int otyp, i;
 
-    while (trop->trclass) {
+       NEARDATA short nocreate = STRANGE_OBJECT;
+       NEARDATA short nocreate2 = STRANGE_OBJECT;
+       NEARDATA short nocreate3 = STRANGE_OBJECT;
+       NEARDATA short nocreate4 = STRANGE_OBJECT;
+
+       while (trop->trclass) {
         otyp = (int) trop->trotyp;
         if (otyp != UNDEF_TYP) {
             obj = mksobj(otyp, TRUE, FALSE);
         } else { /* UNDEF_TYP */
-            static NEARDATA short nocreate = STRANGE_OBJECT;
-            static NEARDATA short nocreate2 = STRANGE_OBJECT;
-            static NEARDATA short nocreate3 = STRANGE_OBJECT;
-            static NEARDATA short nocreate4 = STRANGE_OBJECT;
             /*
              * For random objects, do not create certain overly powerful
              * items: wand of wishing, ring of levitation, or the