]> granicus.if.org Git - nethack/commitdiff
Reveal the monster your strike moved
authorPasi Kallinen <paxed@alt.org>
Sun, 12 Sep 2021 16:44:35 +0000 (19:44 +0300)
committerPasi Kallinen <paxed@alt.org>
Sun, 12 Sep 2021 16:44:39 +0000 (19:44 +0300)
When you hit a small hidden monster (by eg. force-fighting)
that got moved by the strike, the monster stayed hidden, possibly
causing a sanity checking error.

Reveal the monster before hurtling it.

src/dothrow.c

index e91fa8582b0c206f34c6008b0af397b1ae84c096..b170e29697ede4fabc989fb9a9edda0ce8fdc41e 100644 (file)
@@ -982,6 +982,14 @@ mhurtle(struct monst *mon, int dx, int dy, int range)
     if (dx && dy && NODIAG(monsndx(mon->data)))
         return;
 
+    /* undetected monster can be moved by your strike */
+    if (mon->mundetected) {
+        mon->mundetected = 0;
+        newsym(mon->mx, mon->my);
+    }
+    if (M_AP_TYPE(mon))
+        seemimic(mon);
+
     /* Send the monster along the path */
     mc.x = mon->mx;
     mc.y = mon->my;