From a7e312aedc62eccb4f5a11ef674912a4b9894184 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 21 Jun 2007 02:35:30 +0000 Subject: [PATCH] Amulet-covetting monsters attack Wizard Another entry in $cvsroot/shared/bugs/buglist, this one reported by : 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. --- doc/fixes34.4 | 1 + src/wizard.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 08c682f0f..2d35f247d 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -357,6 +357,7 @@ using weapon to kill tame engulfer from inside triggered "placing defunct nymphs could steal carried boulders amnesia of object discoveries would never forget the very last one code controlling item drops by small monsters still used pre-3.1.0 weight +monsters who want the Amulet won't attack the Wizard to try to get it Platform- and/or Interface-Specific Fixes diff --git a/src/wizard.c b/src/wizard.c index 94ebeacf8..7b1a26a11 100644 --- a/src/wizard.c +++ b/src/wizard.c @@ -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;