]> granicus.if.org Git - nethack/commit
Fix bug C343-20 wrong level shown at death
authornhmall <mjnh@persona.ca>
Fri, 18 Dec 2015 01:27:42 +0000 (20:27 -0500)
committernhmall <mjnh@persona.ca>
Fri, 18 Dec 2015 01:27:42 +0000 (20:27 -0500)
commit3e597b688234b7dd4f26ac2a718f3f2d33ef97fc
treede49bb118d7d70828e53e507f56c1d864e9923d5
parent85d7d2bc43d088e4018a1d91e5de099b4e7496f0
Fix bug C343-20 wrong level shown at death

 Changes to be committed:
modified:   doc/fixes36.1
modified:   src/ball.c

I looked up the original bug report that led to bug page C343-20
"When dying immediately on entering a level, the map may show you dying on the previous level."

It was received public report U891:
> When one is being punished and goes down a staircase and dies because the
> ball and chain fell on their head, one gets the message about their death
> while the old level is still being displayed. I wasn't sure whether this
> was a bug or not because on one hand it wouldn't make much sense to
> generate a new level if the character is going to die anyway. However,
> that being said it does make a difference if the character is about to go
> down into a level where one cannot leave bones files, ie medusa or the
> first level of the mines (if i remember correctly). So, if your character
> dies from this does the bones file get left on the level you were on
> (which is still displayed at the time of death) or the level you died as
> soon as you got to (but was never displayed)? Thanks!

Pat had remarked in response: "So this is just a display issue; game play works as intended
(for the program; I imagine you weren't planning to get killed."

A debug trace in wizard mode 3.6.1 beta shows that the relevant code path is this:
NetHack.exe!done(int how) Line 908
NetHack.exe!losehp(int n, const char * knam, char k_format) Line 2678
NetHack.exe!drag_down(...) Line 823
NetHack.exe!goto_level(d_level * newlevel, char at_stairs, char falling, char portal) Line 1316
NetHack.exe!next_level(char at_stairs) Line 1157
NetHack.exe!dodown(...) Line 954
NetHack.exe!rhack(char * cmd) Line 3416
NetHack.exe!moveloop(char resuming) Line 464
NetHack.exe!main(int argc, char * * argv) Line 104

This patch clears the display for the situation in drag_down(),
so the old level is not shown.
doc/fixes36.1
src/ball.c