From: Pasi Kallinen Date: Tue, 5 Jan 2016 22:52:51 +0000 (+0200) Subject: Requiver pickup_thrown objects if quiver is empty X-Git-Tag: NetHack-3.6.1_RC01~1064^2~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e92b80b2ab86398f31598d1b2bef5bdc5a9ac0a1;p=nethack Requiver pickup_thrown objects if quiver is empty Change via Dynahack by Tung Nguyen --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 51e27e78d..ec5d44b9e 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -83,6 +83,7 @@ fix "killing by kicking something weird" when kicking an object causes death guard macros available for mextra fields similar to those for oextra fields compile-time option for an alternate paniclog format for public server use make monsters forget where they stepped when fleeing or teleporting +requiver pickup_thrown objects if quiver is empty Platform- and/or Interface-Specific Fixes diff --git a/src/invent.c b/src/invent.c index 3f0c15b85..1e220bbc4 100644 --- a/src/invent.c +++ b/src/invent.c @@ -434,6 +434,7 @@ struct obj *obj; { struct obj *otmp, *prev; int saved_otyp = (int) obj->otyp; /* for panic */ + boolean obj_was_thrown; if (obj->where != OBJ_FREE) panic("addinv: obj not free"); @@ -442,6 +443,7 @@ struct obj *obj; obj->no_charge = 0; /* should not be set in hero's invent */ if (Has_contents(obj)) picked_container(obj); /* clear no_charge */ + obj_was_thrown = obj->was_thrown; obj->was_thrown = 0; /* not meaningful for invent */ addinv_core1(obj); @@ -476,6 +478,9 @@ struct obj *obj; } obj->where = OBJ_INVENT; + /* fill empty quiver if obj was thrown */ + if (flags.pickup_thrown && !uquiver && obj_was_thrown) + setuqwep(obj); added: addinv_core2(obj); carry_obj_effects(obj); /* carrying affects the obj */