]> granicus.if.org Git - nethack/commitdiff
Fix pet location inconsistency
authorPasi Kallinen <paxed@alt.org>
Mon, 16 Mar 2020 20:13:17 +0000 (22:13 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 16 Mar 2020 20:17:15 +0000 (22:17 +0200)
... if the pet attacked hero or another monster by eg.
swallowing them, the pet's location might've changed
during that attack. Count it as movement, so return
immediately.

src/dogmove.c

index a70c9c70abc4f970cc0b99a3ccaa1cf889792453..57ebcb66a8bbeba53769aed4daae890240af6d4d 100644 (file)
@@ -1181,6 +1181,10 @@ int after; /* this is extra fast monster movement */
                     }
                 }
             }
+
+            /* pet moved when attacking */
+            if (mtmp->mx != omx || mtmp->my != omy)
+                return 0;
         }
     }