From: nethack.rankin Date: Fri, 2 Sep 2005 06:29:15 +0000 (+0000) Subject: fix M167 - hero lycanthrope vulnerable to level drain X-Git-Tag: MOVE2GIT~1242 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=545239f4b13d248056136974b33484821f831858;p=nethack fix M167 - hero lycanthrope vulnerable to level drain From a bug report, player's character inflicted with lycanthropy doesn't gain level drain resistance when in normal form even though lycanthrope monsters do have it when in their human form. The report claimed that the character didn't gain it when in beast form either, but the code--and testing--suggests otherwise. The same resist_drli() call used for monsters is used for the hero, but the is_were() check there isn't able to recognize a lychanthrope hero since youmonst->data doesn't track that when in human/normal form. This adds another more specific check to handle that case. --- diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 2c429a4a4..b221e4803 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -141,6 +141,7 @@ don't suppress corpse if you kill your own steed fix typo in tourist quest leader's greeting fix grammar for graveyard sounds when polymorphed avoid divide by zero crash if Luck drops below -1 while a prayer is in progress +make hero inflicted with lycanthropy immune to level drain just like monsters Platform- and/or Interface-Specific Fixes diff --git a/src/mondata.c b/src/mondata.c index 80513a959..5f7d2ce80 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mondata.c 3.5 2005/01/29 */ +/* SCCS Id: @(#)mondata.c 3.5 2005/09/01 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -82,6 +82,8 @@ struct monst *mon; struct obj *wep = ((mon == &youmonst) ? uwep : MON_WEP(mon)); return (boolean)(is_undead(ptr) || is_demon(ptr) || is_were(ptr) || + /* is_were() doesn't handle hero in human form */ + (mon == &youmonst && u.ulycn >= LOW_PM) || ptr == &mons[PM_DEATH] || is_vampshifter(mon) || (wep && wep->oartifact && defends(AD_DRLI, wep))); }