From: PatR Date: Sat, 5 Dec 2020 20:32:52 +0000 (-0800) Subject: conflicting 'bullets' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e33d658a4a8f6b24684807a5225fb6db262d6d6;p=nethack conflicting 'bullets' This was pointed out several years ago. Since tho different 'static bullets[]' contain different values, give them distinct names. --- diff --git a/src/dothrow.c b/src/dothrow.c index f3015bfd1..f0ed6546e 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -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 */ diff --git a/src/wield.c b/src/wield.c index 5d5b04b94..b5f2dbac8 100644 --- a/src/wield.c +++ b/src/wield.c @@ -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");