From: Pasi Kallinen Date: Wed, 16 Mar 2022 14:51:53 +0000 (+0200) Subject: Remove melting ice timeouts when terrain changes X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1ca594d1cae3922b1c1c906af5e47b5fc0fde7b;p=nethack Remove melting ice timeouts when terrain changes If special level lua code creates a melting ice timeout, but later in the code places stairs, or a trap which might change the ice to room floor, the timer sanity checking doesn't like that. --- diff --git a/src/mklev.c b/src/mklev.c index 3e387bd96..015bc94ff 100644 --- a/src/mklev.c +++ b/src/mklev.c @@ -1635,6 +1635,9 @@ mkstairs(xchar x, xchar y, dest.dlevel = u.uz.dlevel + (up ? -1 : 1); stairway_add(x, y, up ? TRUE : FALSE, FALSE, &dest); + if (levl[x][y].typ == ICE) + spot_stop_timers(x, y, MELT_ICE_AWAY); + levl[x][y].typ = STAIRS; levl[x][y].ladder = up ? LA_UP : LA_DOWN; } diff --git a/src/trap.c b/src/trap.c index b49b6b83c..8290af0a8 100644 --- a/src/trap.c +++ b/src/trap.c @@ -348,6 +348,7 @@ maketrap(int x, int y, int typ) boolean oldplace; struct trap *ttmp; struct rm *lev = &levl[x][y]; + boolean was_ice = (lev->typ == ICE); if ((ttmp = t_at(x, y)) != 0) { if (undestroyable_trap(ttmp->ttyp)) @@ -459,6 +460,8 @@ maketrap(int x, int y, int typ) : DOOR; unearth_objs(x, y); + if (was_ice && lev->typ != ICE) + spot_stop_timers(x, y, MELT_ICE_AWAY); break; }