summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-28 07:19:25 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-28 07:19:25 +0000
commit7da9fbce1aed84ac9b02d8c4f7363ca02429d238 (patch)
treeccf8d14af5e134344cd477453866c2cd682e34db /crawl-ref/source/directn.cc
parentf086209f1e223b89cb392fd71bdebe2f3551f1f7 (diff)
downloadcrawl-ref-7da9fbce1aed84ac9b02d8c4f7363ca02429d238.tar.gz
crawl-ref-7da9fbce1aed84ac9b02d8c4f7363ca02429d238.zip
Backport r10443: generalized way of dealing with "disconnect at --more--"
hacks. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10444 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 9fd43d7dbc..333d733e54 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -138,6 +138,19 @@ void direction_choose_compass( dist& moves, targeting_behaviour *beh)
{
const command_type key_command = beh->get_command();
+#if defined(USE_UNIX_SIGNALS) && defined(SIGHUP_SAVE) && defined(USE_CURSES)
+ // If we've received a HUP signal then the user can't choose a
+ // target.
+ if (crawl_state.seen_hups)
+ {
+ moves.isValid = false;
+ moves.isCancel = true;
+
+ mpr("Targetting interrupted by HUP signal.", MSGCH_ERROR);
+ return;
+ }
+#endif
+
#ifdef USE_TILE
if (key_command == CMD_TARGET_MOUSE_MOVE)
{
@@ -1069,6 +1082,19 @@ void direction(dist& moves, targeting_type restricts,
while (true)
{
+#if defined(USE_UNIX_SIGNALS) && defined(SIGHUP_SAVE) && defined(USE_CURSES)
+ // If we've received a HUP signal then the user can't choose a
+ // target.
+ if (crawl_state.seen_hups)
+ {
+ moves.isValid = false;
+ moves.isCancel = true;
+
+ mpr("Targetting interrupted by HUP signal.", MSGCH_ERROR);
+ return;
+ }
+#endif
+
bool allow_out_of_range = false;
// Prompts might get scrolled off if you have too few lines available.