Don't attempt to cache encumber_msg result

There was only one point in the code at which this caching was
being done, and it was incorrect: it's possible for the result of
near_capacity to change during a monster turn because monster
actions can change either inventory weight or carry capacity.

The bug was particularly relevant in cases where a character
polymorphed into a slow weak monster gets attacked by a monster
that moves at normal speed: due to the polyform being slow, the
normal-speed monster gets in a lot of attacks and causes a
rehumanization, but due to the polyform being weak, it was
burdened at the start of the monster turn, and so when that
penalty is (due to the bug) applied to the next turn it can
mean that the character misses the next turn too, and may end up
dying as a result.
This commit is contained in:
Alex Smith
2025-11-24 02:07:23 +00:00
parent ae516ddc67
commit fce66245ca
20 changed files with 50 additions and 46 deletions

View File

@@ -1535,6 +1535,8 @@ some messages by amorous demons and mail daemon were delivered as verbal ones
travel couldn't find the vibrating square if it was covered by an object or
a monster; it isn't really a trap so treat it as special terrain
travel would stop one step in front of known vibrating square like other traps
fix bug which delayed burden changes due to monster actions (e.g. reverting to
natural form due to damage, changing carry capacity) for one turn
Fixes to 3.7.0-x General Problems Exposed Via git Repository