exercise/abuse while polyd (trunk only)

Three years ago <Someone> reported that even though exercise of
attributes other than wisdom is suppressed while the hero is polymorphed,
attribute gains or losses due to pre-existing exercise can still take
place in that situation.  Since it's an entirely different set of attrs
which will be replaced upon rehumanizing, there's not much point.  (The
same is actually true for wisdom, but I didn't change how exercise works
for it.)  Adopt his one-liner fix:  old exercise won't cause attribute
changes while polymorphed; it will silently fade as it does when its
magnitude is insufficient to trigger a change.

     While checking that out, I noticed that exerchk() was using `/= 2'
to fade out old exercise/abuse.  That will produce platform-dependent
results for negative values (ie, for the abuse case) since C's integer
division doesn't specify whether to truncate towards zero or towards
negative infinity.  In particular, -1 / 2 could yield -1 rather than 0
as the code expected.  (Its impact on play was negligible though.)

     This reduces the code for displaying the messages which accompany
attribute gain/loss.  A few were repharsed in order to simplify that.
This commit is contained in:
nethack.rankin
2008-02-03 06:42:25 +00:00
parent 6968f45024
commit d3b9d28f06
2 changed files with 44 additions and 29 deletions

View File

@@ -278,6 +278,7 @@ potion thrown by monster which hit a long worm's tail gave feedback about
hitting its head
implement energy vortex's previously unused energy drain attack
changing alignment type resets alignment record to 0 (nomimally aligned)
while polymorphed, suppress attribute gain/lose earned by pre-poly exercise
Platform- and/or Interface-Specific Fixes