Generalized solution to the "disconnect at --more--" problem (e.g., disconnect

at the more after "You have lost your religion!" to avoid the negative consequences of excommunication): when a HUP signal is received, instead of immediately saving the game, close the stdin stream, which will cause all of the Curses calls which normal block on key-presses to unblock, so that the code after a more() call will execute before the disconnected game is saved (which will happen in _input() in acr.cc). This only affects Curses (non-tiles/console) UNIX builds which have both USE_UNIX_SIGNALS and SIGHUP_SAVE defined.

Exceptions to the above:

  • If HUP is received during a call to yesno() with safeanswer == 0, then the game will be saved immediately, since there's no way for the function to tell which answer is safe to give automatically.

  • If HUP is received while selecting the target for a controlled teleport then the teleport will be canceled, since otherwise a target other than the intended one might be the one under the cursor when the disconnect happened.

git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10443 c06c8d41-db1a-0410-9941-cceddc491573

Created by  zelgadis  on July 28, 2009
C7WZ2EB2RK7JH5UG34EHFFOLHG5UVJU7BDRJ5J5GCB2ZRIVQGLGAC
Dependencies
In channels
main
Change contents