]> granicus.if.org Git - nethack/commitdiff
non-moving goal-oriented monsters
authorcohrs <cohrs>
Wed, 13 Feb 2002 03:26:24 +0000 (03:26 +0000)
committercohrs <cohrs>
Wed, 13 Feb 2002 03:26:24 +0000 (03:26 +0000)
Monsters with goals like M3_WANTSBOOK often wouldn't move if another
monster was standing on the the goal object, add code for the missing case

doc/fixes34.0
src/wizard.c

index 6096b7b3e1e84f2684f61c492b6f4abdd0613b5e..492de43365edd9b3c8db6ec0821077c173e2ab6c 100644 (file)
@@ -427,6 +427,7 @@ make wands of speed or slow monster known if their effect
        on monsters is observed; likewise for speed boots
 gold detection "materially poor" message inappropriate if you have hidden_gold()
 cannot reflect back an invisible umber hulk or medusa's attack
+monsters with M3_WANTSBOOK often couldn't move in the Wizard-level
 
 
 Platform- and/or Interface-Specific Fixes
index ba216b82a7d6ae7d47e4cd5033cdd6d8a99c76d1..851501ecd25939d7e303e465af7f9e063e586f2d 100644 (file)
@@ -341,21 +341,25 @@ tactics(mtmp)
                    return(0);
                }
                if(where == STRAT_GROUND) {
-                 if(!MON_AT(tx, ty) || (mtmp->mx == tx && mtmp->my == ty)) {
-                   /* teleport to it and pick it up */
-                   rloc_to(mtmp, tx, ty);      /* clean old pos */
-
-                   if ((otmp = on_ground(which_arti(targ))) != 0) {
-                       if (cansee(mtmp->mx, mtmp->my))
-                           pline("%s picks up %s.",
-                                 Monnam(mtmp),
-                                 (distu(mtmp->my, mtmp->my) <= 5) ?
-                                   doname(otmp) : distant_name(otmp, doname));
-                       obj_extract_self(otmp);
-                       (void) mpickobj(mtmp, otmp);
-                       return(1);
-                   } else return(0);
-                 }
+                   if(!MON_AT(tx, ty) || (mtmp->mx == tx && mtmp->my == ty)) {
+                       /* teleport to it and pick it up */
+                       rloc_to(mtmp, tx, ty);  /* clean old pos */
+
+                       if ((otmp = on_ground(which_arti(targ))) != 0) {
+                           if (cansee(mtmp->mx, mtmp->my))
+                               pline("%s picks up %s.",
+                                   Monnam(mtmp),
+                                   (distu(mtmp->my, mtmp->my) <= 5) ?
+                                    doname(otmp) : distant_name(otmp, doname));
+                           obj_extract_self(otmp);
+                           (void) mpickobj(mtmp, otmp);
+                           return(1);
+                       } else return(0);
+                   } else {
+                       /* a monster is standing on it - cause some trouble */
+                       if (!rn2(5)) mnexto(mtmp);
+                       return(0);
+                   }
                } else { /* a monster has it - 'port beside it. */
                    (void) mnearto(mtmp, tx, ty, TRUE);
                    return(0);