ComputerScienceHouse / bingehack

A fork of nethack with semi-multiplayer features and other customizations. (An in-heavy-development fork version is at https://github.com/computersciencehouse/bingehack4 )
http://nethack.csh.rit.edu
23 stars 4 forks source link

Opening your inventory when it's empty crashes the game. #119

Closed eatnumber1 closed 11 years ago

eatnumber1 commented 12 years ago

In the new interface, the game crashes if you open your inventory when it's empty.

The game prints the message curses_display_nhmenu: attempt to display empty menu

clockfort commented 12 years ago

Unable to reproduce; I correctly get "Not carrying anything.", even while using curses interface. Attach a coredump/ stack trace if you can reproduce locally.

eatnumber1 commented 12 years ago

From invent.c:1865

Exit early if no inventory -- but keep going if we are doing
a permanent inventory update.  We need to keep going so the
permanent inventory window updates itself to remove the last
item(s) dropped.  One down side:  the addition of the exception
for permanent inventory window updates _can_ pop the window
up when it's not displayed -- even if it's empty -- because we
don't know at this level if its up or not.  This may not be
an issue if empty checks are done before hand and the call
to here is short circuited away.

Followed by a complex check which if true, prints the Not carrying anything message. Clearly, I'm failing that check. Needs more investigation later.

eatnumber1 commented 11 years ago

This is fixed by 5f7f2eef14879bf007e0eecece4d37320ecab02e