From: Pasi Kallinen Date: Wed, 23 Feb 2022 09:30:51 +0000 (+0200) Subject: Make minliquid handle walls of water X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4eaa8cd0557dd5a591c0270db5e9e06d54a17843;p=nethack Make minliquid handle walls of water --- diff --git a/src/mon.c b/src/mon.c index 825601b14..b2a25a4f5 100644 --- a/src/mon.c +++ b/src/mon.c @@ -708,6 +708,7 @@ static int minliquid_core(struct monst* mtmp) { boolean inpool, inlava, infountain; + boolean waterwall = (levl[mtmp->mx][mtmp->my].typ == WATER); /* [ceiling clingers are handled below] */ inpool = (is_pool(mtmp->mx, mtmp->my) @@ -723,7 +724,7 @@ minliquid_core(struct monst* mtmp) water location on the Plane of Water, flight and levitating are blocked so this (Flying || Levitation) test fails there and steed will be subject to water effects, as intended) */ - if (mtmp == u.usteed && (Flying || Levitation)) + if (mtmp == u.usteed && (Flying || Levitation) && !waterwall) return 0; /* Gremlin multiplying won't go on forever since the hit points @@ -801,13 +802,13 @@ minliquid_core(struct monst* mtmp) } return 1; } - } else if (inpool) { + } else if (inpool || waterwall) { /* Most monsters drown in pools. flooreffects() will take care of * water damage to dead monsters' inventory, but survivors need to * be handled here. Swimmers are able to protect their stuff... */ - if (!is_clinger(mtmp->data) && !is_swimmer(mtmp->data) - && !amphibious(mtmp->data)) { + if ((waterwall || !is_clinger(mtmp->data)) + && !is_swimmer(mtmp->data) && !amphibious(mtmp->data)) { /* like hero with teleport intrinsic or spell, teleport away if possible */ if (can_teleport(mtmp->data) && !tele_restrict(mtmp)) {