]> granicus.if.org Git - nethack/commitdiff
Prevent monster hurtling outside map
authorPasi Kallinen <paxed@alt.org>
Thu, 3 Mar 2022 20:23:25 +0000 (22:23 +0200)
committerPasi Kallinen <paxed@alt.org>
Thu, 3 Mar 2022 20:24:17 +0000 (22:24 +0200)
src/dothrow.c

index 3eb5374acb29b4bfa1c8ccffed96f1d2d6d2b6e5..7d56dfef49cdfa22f34c09ce72210a4a5e627f81 100644 (file)
@@ -910,6 +910,9 @@ mhurtle_step(genericptr_t arg, int x, int y)
     /* TODO: Treat walls, doors, iron bars, etc. specially
      * rather than just stopping before.
      */
+    if (!isok(x, y))
+        return FALSE;
+
     if (goodpos(x, y, mon, MM_IGNOREWATER | MM_IGNORELAVA)
         && m_in_out_region(mon, x, y)) {
         int res;