]> granicus.if.org Git - nethack/commitdiff
Handle water and lava when hurtling a monster
authorPasi Kallinen <paxed@alt.org>
Tue, 22 Feb 2022 14:51:13 +0000 (16:51 +0200)
committerPasi Kallinen <paxed@alt.org>
Tue, 22 Feb 2022 14:51:18 +0000 (16:51 +0200)
Also delay the output, showing the hurtle animation.

src/dothrow.c

index 6dff8198094ece2fa154143247c262d4e4ffded6..f89124522fa0e5056be1a6ce89296a76c423128e 100644 (file)
@@ -637,6 +637,8 @@ walk_path(coord *src_cc, coord *dest_cc,
             /* check for early exit condition */
             if (!(keep_going = (*check_proc)(arg, x, y)))
                 break;
+            flush_screen(1);
+            delay_output();
         }
     } else {
         while (i++ < dx) {
@@ -651,6 +653,8 @@ walk_path(coord *src_cc, coord *dest_cc,
             /* check for early exit condition */
             if (!(keep_going = (*check_proc)(arg, x, y)))
                 break;
+            flush_screen(1);
+            delay_output();
         }
     }
 
@@ -903,6 +907,17 @@ mhurtle_step(genericptr_t arg, int x, int y)
     struct monst *mon = (struct monst *) arg;
     struct monst *mtmp;
 
+    if (is_pool(x, y) || is_lava(x, y)) {
+        remove_monster(mon->mx, mon->my);
+        newsym(mon->mx, mon->my);
+        place_monster(mon, x, y);
+        newsym(mon->mx, mon->my);
+        set_apparxy(mon);
+        if (minliquid(mon))
+            return FALSE;
+        return TRUE;
+    }
+
     /* TODO: Treat walls, doors, iron bars, pools, lava, etc. specially
      * rather than just stopping before.
      */