From 9033b8071957ed45e5e24249796334a195a61111 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Sun, 9 Feb 2003 00:36:33 +0000 Subject: [PATCH] fix B18011 warning loss > If you remove a ring of warning, see_monsters() is called to make > sure that the numbers get removed from the display. However, if > your only source of warning is experience level and you get > drained and feel "less sensitive", it isn't, and they're not. --- doc/fixes34.1 | 2 ++ src/attrib.c | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 0777903f4..948726e8b 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -374,6 +374,8 @@ using travel mode to move next to a known trap and then trying to step onto that trap required an extra step; the first one ended up as a no-op punished with ball and chain on the same floor square as a trapped chest when it exploded resulted in panic "remove_object: obj not on floor" +see_monsters() wasn't called when you lost the innate warning intrinsic due + to level loss Platform- and/or Interface-Specific Fixes diff --git a/src/attrib.c b/src/attrib.c index 12945c57b..e13f83007 100644 --- a/src/attrib.c +++ b/src/attrib.c @@ -98,6 +98,7 @@ const struct innate { static long next_check = 600L; /* arbitrary first setting */ STATIC_DCL void NDECL(exerper); +STATIC_DCL void FDECL(postadjabil, (long *)); /* adjust an attribute; return TRUE if change is made, FALSE otherwise */ boolean @@ -521,6 +522,15 @@ redist_attr() (void)encumber_msg(); } +void +postadjabil(ability) +long *ability; +{ + if (!ability) return; + if (ability == &(HWarning) || ability == &(HSee_invisible)) + see_monsters(); +} + void adjabil(oldlevel,newlevel) int oldlevel, newlevel; @@ -558,6 +568,7 @@ int oldlevel, newlevel; } while (abil || rabil) { + long prevabil; /* Have we finished with the intrinsics list? */ if (!abil || !abil->ability) { /* Try the race intrinsics */ @@ -566,7 +577,7 @@ int oldlevel, newlevel; rabil = 0; mask = FROMRACE; } - + prevabil = *(abil->ability); if(oldlevel < abil->ulevel && newlevel >= abil->ulevel) { /* Abilities gained at level 1 can never be lost * via level loss, only via means that remove _any_ @@ -591,6 +602,8 @@ int oldlevel, newlevel; You_feel("less %s!", abil->gainstr); } } + if (prevabil != *(abil->ability)) /* it changed */ + postadjabil(abil->ability); abil++; } -- 2.40.0