]> granicus.if.org Git - nethack/commitdiff
Requiver pickup_thrown objects if quiver is empty
authorPasi Kallinen <paxed@alt.org>
Tue, 5 Jan 2016 22:52:51 +0000 (00:52 +0200)
committerPasi Kallinen <paxed@alt.org>
Tue, 5 Jan 2016 22:53:03 +0000 (00:53 +0200)
Change via Dynahack by Tung Nguyen

doc/fixes36.1
src/invent.c

index 51e27e78d0ce4bc8df9b98a2abe6a79127aefc90..ec5d44b9e10b338cf412681fb0ad8ff147916e2d 100644 (file)
@@ -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
index 3f0c15b8599d75033e66f2bd6c89eddd81c49934..1e220bbc45a5ada7c0e028e66fb7d2408230f4e1 100644 (file)
@@ -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 */