]> granicus.if.org Git - nethack/commitdiff
ice followup
authornethack.allison <nethack.allison>
Tue, 14 Oct 2003 11:06:58 +0000 (11:06 +0000)
committernethack.allison <nethack.allison>
Tue, 14 Oct 2003 11:06:58 +0000 (11:06 +0000)
Ensure that we don't start a timer on ice that
the player or a monster didn't create when
zapping existing ice.

src/zap.c

index 2d3037021d7e5a811347b184b95b94d2941b402e..b2c92111f0035f1b6de0161ec64bbd3939586096 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -3674,8 +3674,11 @@ boolean *shopdamage;
        }
        else if(abstype == ZT_COLD && is_ice(x,y)) {
                /* Already ice here, so just firm it up. */
-               spot_stop_timers(x, y, MELT_ICE_AWAY); /* stop existing timer */
-               start_melt_ice_timeout(x,y);           /* start new timer */
+               /* Now ensure that only ice that is already timed is affected */
+               if (spot_time_left(x,y,MELT_ICE_AWAY)) { 
+                   spot_stop_timers(x, y, MELT_ICE_AWAY); /* stop existing timer */
+                   start_melt_ice_timeout(x,y);           /* start new timer */
+               }
        }
        if(closed_door(x, y)) {
                int new_doormask = -1;