Requiver pickup_thrown objects if quiver is empty

Change via Dynahack by Tung Nguyen
This commit is contained in:
Pasi Kallinen
2016-01-06 00:53:03 +02:00
parent 192d1bd89e
commit e92b80b2ab
2 changed files with 6 additions and 0 deletions
+1
View 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 guard macros available for mextra fields similar to those for oextra fields
compile-time option for an alternate paniclog format for public server use compile-time option for an alternate paniclog format for public server use
make monsters forget where they stepped when fleeing or teleporting make monsters forget where they stepped when fleeing or teleporting
requiver pickup_thrown objects if quiver is empty
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
+5
View File
@@ -434,6 +434,7 @@ struct obj *obj;
{ {
struct obj *otmp, *prev; struct obj *otmp, *prev;
int saved_otyp = (int) obj->otyp; /* for panic */ int saved_otyp = (int) obj->otyp; /* for panic */
boolean obj_was_thrown;
if (obj->where != OBJ_FREE) if (obj->where != OBJ_FREE)
panic("addinv: obj not 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 */ obj->no_charge = 0; /* should not be set in hero's invent */
if (Has_contents(obj)) if (Has_contents(obj))
picked_container(obj); /* clear no_charge */ picked_container(obj); /* clear no_charge */
obj_was_thrown = obj->was_thrown;
obj->was_thrown = 0; /* not meaningful for invent */ obj->was_thrown = 0; /* not meaningful for invent */
addinv_core1(obj); addinv_core1(obj);
@@ -476,6 +478,9 @@ struct obj *obj;
} }
obj->where = OBJ_INVENT; obj->where = OBJ_INVENT;
/* fill empty quiver if obj was thrown */
if (flags.pickup_thrown && !uquiver && obj_was_thrown)
setuqwep(obj);
added: added:
addinv_core2(obj); addinv_core2(obj);
carry_obj_effects(obj); /* carrying affects the obj */ carry_obj_effects(obj); /* carrying affects the obj */