fix #H8612 - splashes of venom might stay intact

If a poly'd hero spits venom and it lands at a 'soft' spot such as
water, it would remain as an intact venom object.  (Venom spat by
monsters seems to always be used up regardless of where it lands.)
This commit is contained in:
PatR
2019-04-25 07:11:42 -07:00
parent f838967c04
commit 75db8e004d
3 changed files with 11 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 dothrow.c $NHDT-Date: 1550868876 2019/02/22 20:54:36 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.158 $ */
/* NetHack 3.6 dothrow.c $NHDT-Date: 1556201496 2019/04/25 14:11:36 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.160 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1378,7 +1378,10 @@ boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
}
}
if (!IS_SOFT(levl[bhitpos.x][bhitpos.y].typ) && breaktest(obj)) {
if ((!IS_SOFT(levl[bhitpos.x][bhitpos.y].typ) && breaktest(obj))
/* venom [via #monster to spit while poly'd] fails breaktest()
but we want to force breakage even when location IS_SOFT() */
|| obj->oclass == VENOM_CLASS) {
tmp_at(DISP_FLASH, obj_to_glyph(obj, rn2_on_display_rng));
tmp_at(bhitpos.x, bhitpos.y);
delay_output();
@@ -1899,6 +1902,7 @@ xchar x, y; /* object location (ox, oy may not be right) */
boolean from_invent; /* thrown or dropped by player; maybe on shop bill */
{
boolean in_view = Blind ? FALSE : (from_invent || cansee(x, y));
if (!breaktest(obj))
return 0;
breakmsg(obj, in_view);