]> granicus.if.org Git - nethack/commitdiff
Fix flipping some monsters
authorPasi Kallinen <paxed@alt.org>
Sun, 8 Mar 2020 18:01:39 +0000 (20:01 +0200)
committerPasi Kallinen <paxed@alt.org>
Sun, 8 Mar 2020 18:01:41 +0000 (20:01 +0200)
Don't flip the guard waiting to be disposed of.
Don't flip the occasional monster (usually an earth elemental)
outside the level bounds.

src/sp_lev.c

index 01f71001b1ef37b0c61346f76e2bd43dbda3b7b0..c0f5259e16de509c12f72335772de8a77c9e721e 100755 (executable)
@@ -527,6 +527,12 @@ boolean extras;
 
     /* monsters */
     for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
+        if (mtmp->isgd && mtmp->mx == 0)
+            continue;
+        /* skip the occasional earth elemental outside the flip area */
+        if (mtmp->mx < minx || mtmp->mx > maxx
+            || mtmp->my < miny || mtmp->my > maxy)
+            continue;
        if (flp & 1) {
            mtmp->my = FlipY(mtmp->my);
            if (mtmp->ispriest)