From b76f8aab8dfde646fdf46a3fd908c937b6a62954 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sun, 1 Mar 2009 03:49:54 +0000 Subject: [PATCH] offshoot of #H1820 - priests/minions vs opposite alignment (trunk only) In #H1820, reported that helms of opposite alignment didn't work for monsters. There's never been any attempt to implement that, and it wasn't omitted by accident, so I wouldn't classify it as a bug. But it does seem buggy that temple priests and minions of would be willing to put such helms on and risk changing allegiance to another deity. This lets other types of monsters still wear helms of opposite alignment as ordinary head protection, but the explicity aligned creatures won't do so anymore. --- doc/fixes35.0 | 1 + src/worn.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 2144c7d0d..86873aa6a 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -314,6 +314,7 @@ attacking via applied polearm never scuffed engraving underneath hero auto-wielding a polearm took no time if ESC was used to cancel target choice applying a bullwhip while at very edge of map could target beyond edge, potentially leading to a panic or crash +prevent temple priests and minions from wearing helms of opposite alignment Platform- and/or Interface-Specific Fixes diff --git a/src/worn.c b/src/worn.c index fa924bd5e..361a879e0 100644 --- a/src/worn.c +++ b/src/worn.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)worn.c 3.5 2008/09/03 */ +/* SCCS Id: @(#)worn.c 3.5 2009/02/28 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -503,6 +503,11 @@ boolean racialexception; break; case W_ARMH: if (!is_helmet(obj)) continue; + /* changing alignment is not implemented for monsters; + priests and minions could change alignment but wouldn't + want to, so they reject helms of opposite alignment */ + if (obj->otyp == HELM_OF_OPPOSITE_ALIGNMENT && + (mon->ispriest || mon->isminion)) continue; /* (flimsy exception matches polyself handling) */ if (has_horns(mon->data) && !is_flimsy(obj)) continue; break;