]> granicus.if.org Git - nethack/commitdiff
conflicting 'bullets'
authorPatR <rankin@nethack.org>
Sat, 5 Dec 2020 20:32:52 +0000 (12:32 -0800)
committerPatR <rankin@nethack.org>
Sat, 5 Dec 2020 20:32:52 +0000 (12:32 -0800)
This was pointed out several years ago.  Since tho different
'static bullets[]' contain different values, give them distinct
names.

src/dothrow.c
src/wield.c

index f3015bfd17b79f7b632e6e466a766a8ad57c22ce..f0ed6546eb710f6aa3ca335963d1af55afe7c0ab 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 dothrow.c       $NHDT-Date: 1606343578 2020/11/25 22:32:58 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.190 $ */
+/* NetHack 3.7 dothrow.c       $NHDT-Date: 1607200366 2020/12/05 20:32:46 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.191 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2013. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -23,8 +23,9 @@ static boolean FDECL(mhurtle_step, (genericptr_t, int, int));
 static NEARDATA const char toss_objs[] = { ALLOW_COUNT, COIN_CLASS,
                                            ALL_CLASSES, WEAPON_CLASS, 0 };
 /* different default choices when wielding a sling (gold must be included) */
-static NEARDATA const char bullets[] = { ALLOW_COUNT, COIN_CLASS, ALL_CLASSES,
-                                         GEM_CLASS, 0 };
+static NEARDATA const char t_bullets[] = {
+    ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, GEM_CLASS, 0
+};
 
 /* g.thrownobj (decl.c) tracks an object until it lands */
 
@@ -295,7 +296,7 @@ dothrow()
     if (!ok_to_throw(&shotlimit))
         return 0;
 
-    obj = getobj(uslinging() ? bullets : toss_objs, "throw");
+    obj = getobj(uslinging() ? t_bullets : toss_objs, "throw");
     /* it is also possible to throw food */
     /* (or jewels, or iron balls... ) */
 
@@ -407,7 +408,7 @@ dofire()
                use direction of previous throw as getobj()'s choice here */
             g.in_doagain = 0;
             /* choose something from inventory, then usually quiver it */
-            obj = getobj(uslinging() ? bullets : toss_objs, "throw");
+            obj = getobj(uslinging() ? t_bullets : toss_objs, "throw");
             /* Q command doesn't allow gold in quiver */
             if (obj && !obj->owornmask && obj->oclass != COIN_CLASS)
                 setuqwep(obj); /* demi-autoquiver */
index 5d5b04b941ca45627e8311164627de9fde72c2e3..b5f2dbac8ee60ebb2988fe370cf450f63263d770 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 wield.c $NHDT-Date: 1596498228 2020/08/03 23:43:48 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.77 $ */
+/* NetHack 3.7 wield.c $NHDT-Date: 1607200367 2020/12/05 20:32:47 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.78 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2009. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -275,7 +275,7 @@ static NEARDATA const char wield_objs[] = {
 static NEARDATA const char ready_objs[] = {
     ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, ALLOW_NONE, WEAPON_CLASS, 0
 };
-static NEARDATA const char bullets[] = { /* (note: different from dothrow.c) */
+static NEARDATA const char w_bullets[] = { /* (different from dothrow.c) */
     ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, ALLOW_NONE,
     GEM_CLASS, WEAPON_CLASS, 0
 };
@@ -455,7 +455,7 @@ dowieldquiver()
     quivee_types = (uslinging()
                     || (uswapwep
                         && objects[uswapwep->otyp].oc_skill == P_SLING))
-                   ? bullets
+                   ? w_bullets
                    : ready_objs;
     newquiver = getobj(quivee_types, "ready");