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.
This commit is contained in:
nethack.allison
2003-02-09 00:36:33 +00:00
parent 7dbed130dc
commit 9033b80719
2 changed files with 16 additions and 1 deletions

View File

@@ -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

View File

@@ -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++;
}