]> granicus.if.org Git - nethack/commitdiff
flyers vs kelp
authorPatR <rankin@nethack.org>
Sat, 25 Jun 2016 21:59:52 +0000 (14:59 -0700)
committerPatR <rankin@nethack.org>
Sat, 25 Jun 2016 21:59:52 +0000 (14:59 -0700)
Flying monsters that want to pick up items tend to get stuck above
kelp fronds, particularly on the Medusa level.  They're allowed to
move to the water location, but can't reach an underwater item so
end up doing nothing.

doc/fixes36.1
src/monmove.c

index cb61f02311ce03998dfbffab7a23e17776034bce..e74e647e11156d96a61f43af6841e581903d007e 100644 (file)
@@ -302,6 +302,7 @@ conduct: wishing for an artifact and not getting it because it already exists
 avoid ring of poison resistance as starting equipment for orcish wizard
 gelatinous cube shouldn't be able to eat a scroll of scare monster
 make fireballs or cones of cold cast a skilled or higher not go through walls
+prevent flying monsters from hovering over unreachable underwater objects
 
 
 Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository
index c703f2231797ca88f8b0627639137f39058b0b05..c032db50404f1f6ecfd4cad8bc445cdd0940e05c 100644 (file)
@@ -979,15 +979,21 @@ not_special:
                  * mpickstuff() as well.
                  */
                 if (xx >= lmx && xx <= oomx && yy >= lmy && yy <= oomy) {
-                    /* don't get stuck circling around an object that's
-                       underneath
-                       an immobile or hidden monster; paralysis victims
-                       excluded */
+                    /* don't get stuck circling around object that's
+                       underneath an immobile or hidden monster;
+                       paralysis victims excluded */
                     if ((mtoo = m_at(xx, yy)) != 0
                         && (mtoo->msleeping || mtoo->mundetected
                             || (mtoo->mappearance && !mtoo->iswiz)
                             || !mtoo->data->mmove))
                         continue;
+                    /* the mfndpos() test for whether to allow a move to a
+                       water location accepts flyers, but they can't reach
+                       underwater objects, so being able to move to a spot
+                       is insufficient for deciding whether to do so */
+                    if ((is_pool(xx, yy) && !is_swimmer(ptr))
+                        || (is_lava(xx, yy) && !likes_lava(ptr)))
+                        continue;
 
                     if (((likegold && otmp->oclass == COIN_CLASS)
                          || (likeobjs && index(practical, otmp->oclass)