]> granicus.if.org Git - nethack/commitdiff
Message fix for burden changes during end-of-turn updates
authorAlex Smith <ais523@nethack4.org>
Wed, 5 Jan 2022 23:17:27 +0000 (23:17 +0000)
committerAlex Smith <ais523@nethack4.org>
Wed, 5 Jan 2022 23:17:27 +0000 (23:17 +0000)
This fixes the messages displayed when, e.g., the hero becomes
unburdened as a consequence of a corpse rotting away. (There are no
gameplay changes; the effective burden level is fixed between turns
under both the old and new mechanisms, and any other use of it will
recalculate it prior to using it.)

Not changed: the interaction of overexert_hp with burden changes due
to timeout. You were holding the corpse during your turn, so even if
it rots away at the end of the turn, you can still pass out from the
exertion you applied during that turn.

src/allmain.c

index 1e0053a122fe58547138222c6327edecfe4bdcc5..66a0dd69c1d2458d0481bf1cbf19fb1fc0c72c37 100644 (file)
@@ -355,6 +355,14 @@ moveloop_core(void)
         /******************************************/
 
         g.hero_seq++; /* moves*8 + n for n == 1..7 */
+
+        /* although we checked for encumberance above, we need to
+           check again for message purposes, as the weight of
+           inventory may have changed in, e.g., nh_timeout(); we do
+           need two checks here so that the player gets feedback
+           immediately if their own action encumbered them */
+        encumber_msg();
+
 #ifdef STATUS_HILITES
         if (iflags.hilite_delta)
             status_eval_next_unhilite();