Amulet-covetting monsters attack Wizard

Another entry in $cvsroot/shared/bugs/buglist, this one reported by
<email deleted>:  if the Wizard had the Amulet and used
his "double trouble" spell, his clone would attack him in order to try to
get the Amulet.  This prevents any monster who's after the Amulet from
attacking the Wizard to get it.
This commit is contained in:
nethack.rankin
2007-06-21 02:35:30 +00:00
parent d34e557df5
commit a7e312aedc
2 changed files with 4 additions and 1 deletions

View File

@@ -225,7 +225,9 @@ target_on(mask, mtmp)
return(STRAT(STRAT_PLAYER, u.ux, u.uy, mask));
else if((otmp = on_ground(otyp)))
return(STRAT(STRAT_GROUND, otmp->ox, otmp->oy, mask));
else if((mtmp2 = other_mon_has_arti(mtmp, otyp)))
else if ((mtmp2 = other_mon_has_arti(mtmp, otyp)) != 0 &&
/* avoid targetting the Wizard for the Amulet */
(!mtmp2->iswiz || otyp != AMULET_OF_YENDOR))
return(STRAT(STRAT_MONSTR, mtmp2->mx, mtmp2->my, mask));
}
return (unsigned long)STRAT_NONE;