From: cohrs Date: Wed, 13 Feb 2002 03:26:24 +0000 (+0000) Subject: non-moving goal-oriented monsters X-Git-Tag: MOVE2GIT~3186 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6d0723aae2fb194920b6fb8118132fa5ea169f4f;p=nethack non-moving goal-oriented monsters 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 --- diff --git a/doc/fixes34.0 b/doc/fixes34.0 index 6096b7b3e..492de4336 100644 --- a/doc/fixes34.0 +++ b/doc/fixes34.0 @@ -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 diff --git a/src/wizard.c b/src/wizard.c index ba216b82a..851501ecd 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -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);