adjust wish for cockatrice corpse

Wishing is powerful, so if you cannot safely handle a cockatrice
corpse, then have a wish for one result in the corpse materializing
on the floor rather than in your inventory.

Resolves #1320
This commit is contained in:
nhmall
2024-11-09 14:06:43 -05:00
parent 36d8998edb
commit 9c554895b1
5 changed files with 28 additions and 4 deletions

View File

@@ -1230,6 +1230,12 @@ hold_another_object(
dropped, avoid perminv update when temporarily adding it */
obj = addinv_core0(obj, (struct obj *) 0, FALSE);
goto drop_it;
} else if (obj->otyp == CORPSE
&& !u_safe_from_fatal_corpse(obj)
&& obj->wishedfor) {
obj->wishedfor = 0;
obj = addinv_core0(obj, (struct obj *) 0, FALSE);
goto drop_it;
} else {
long oquan = obj->quan;
int prev_encumbr = near_capacity(); /* before addinv() */