potionbreathe's obj->in_use
potionbreathe() uses obj->in_use as a flag to inhibit wielded unholy water from being dropped in case that gets broken against a monster and triggers the hero to change from human were-critter to beast were- critter. Reset that to zero if caller hasn't already set it to 1.
This commit is contained in:
+6
-1
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.7 potion.c $NHDT-Date: 1629317892 2021/08/18 20:18:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.200 $ */
|
/* NetHack 3.7 potion.c $NHDT-Date: 1629497464 2021/08/20 22:11:04 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.201 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
/*-Copyright (c) Robert Patrick Rankin, 2013. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
@@ -1804,6 +1804,7 @@ potionbreathe(struct obj *obj)
|
|||||||
{
|
{
|
||||||
int i, ii, isdone, kn = 0;
|
int i, ii, isdone, kn = 0;
|
||||||
boolean cureblind = FALSE;
|
boolean cureblind = FALSE;
|
||||||
|
unsigned already_in_use = obj->in_use;
|
||||||
|
|
||||||
/* potion of unholy water might be wielded; prevent
|
/* potion of unholy water might be wielded; prevent
|
||||||
you_were() -> drop_weapon() from dropping it so that it
|
you_were() -> drop_weapon() from dropping it so that it
|
||||||
@@ -1971,6 +1972,9 @@ potionbreathe(struct obj *obj)
|
|||||||
break;
|
break;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!already_in_use)
|
||||||
|
obj->in_use = 0;
|
||||||
/* note: no obfree() -- that's our caller's responsibility */
|
/* note: no obfree() -- that's our caller's responsibility */
|
||||||
if (obj->dknown) {
|
if (obj->dknown) {
|
||||||
if (kn)
|
if (kn)
|
||||||
@@ -1979,6 +1983,7 @@ potionbreathe(struct obj *obj)
|
|||||||
&& !objects[obj->otyp].oc_uname)
|
&& !objects[obj->otyp].oc_uname)
|
||||||
docall(obj);
|
docall(obj);
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns the potion type when o1 is dipped in o2 */
|
/* returns the potion type when o1 is dipped in o2 */
|
||||||
|
|||||||
Reference in New Issue
Block a user