suppress obsolete restore_attrib()
moveloop() has been calling restore_attrib() every turn, and restore_attrib() loops through all six characteristics every time to check for ones that have temporary adjustments timing out. But ATIME(characteristic) is never set anywhere and no time outs would occur. So delete the call to restore_attrib() from moveloop(). This leaves that no-longer-called routine in place and updates it to handle Wounded_legs properly in case it ever does get used. Also, add a comment about "restore ability" not fixing temporarily lost characteristics due to hunger or wounded legs. And update unfixable_trouble_count() to check for those so that restore ability won't say "you feel great" when it fails to fix them.
This commit is contained in:
12
src/potion.c
12
src/potion.c
@@ -598,6 +598,8 @@ dopotion(struct obj *otmp)
|
||||
return ECMD_TIME;
|
||||
}
|
||||
|
||||
/* potion or spell of restore ability; for spell, otmp is a temporary
|
||||
spellbook object that will be blessed if hero is skilled in healing */
|
||||
static void
|
||||
peffect_restore_ability(struct obj *otmp)
|
||||
{
|
||||
@@ -608,11 +610,13 @@ peffect_restore_ability(struct obj *otmp)
|
||||
} else {
|
||||
int i, ii;
|
||||
|
||||
/* unlike unicorn horn, overrides Fixed_abil */
|
||||
/* unlike unicorn horn, overrides Fixed_abil;
|
||||
does not recover temporary strength loss due to hunger
|
||||
or temporary dexterity loss due to wounded legs */
|
||||
pline("Wow! This makes you feel %s!",
|
||||
(otmp->blessed)
|
||||
? (unfixable_trouble_count(FALSE) ? "better" : "great")
|
||||
: "good");
|
||||
(!otmp->blessed) ? "good"
|
||||
: unfixable_trouble_count(FALSE) ? "better"
|
||||
: "great");
|
||||
i = rn2(A_MAX); /* start at a random point */
|
||||
for (ii = 0; ii < A_MAX; ii++) {
|
||||
int lim = AMAX(i);
|
||||
|
||||
Reference in New Issue
Block a user