diff options
author | Adam Borowski <kilobyte@angband.pl> | 2012-11-21 14:11:59 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2012-11-21 14:11:59 +0100 |
commit | 58457ea65098736276e7220cc4eec07c3b9abf39 (patch) | |
tree | 2eefb8a30f353e0e1163f042beecfb1fefbbdec1 /crawl-ref/source/uncancel.h | |
parent | 376ddfc049875365fb21d902f7529017d3d12022 (diff) | |
download | crawl-ref-58457ea65098736276e7220cc4eec07c3b9abf39.tar.gz crawl-ref-58457ea65098736276e7220cc4eec07c3b9abf39.zip |
Don't lose acquirement if you disconnect at the prompt.
People are quite likely to stop and think, consult ##crawl, etc. And
thinking is tiresome, folks get distracted... and then it's a time-out,
they turn the computer without thinking and go to sleep, etc.
This adds a new mechanism: "uncancellables", which allows an action to
restart when the game is loaded back.
Diffstat (limited to 'crawl-ref/source/uncancel.h')
-rw-r--r-- | crawl-ref/source/uncancel.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crawl-ref/source/uncancel.h b/crawl-ref/source/uncancel.h new file mode 100644 index 0000000000..b5501e1a1d --- /dev/null +++ b/crawl-ref/source/uncancel.h @@ -0,0 +1,19 @@ +/** + * @file + * @brief User interactions that need to be restarted if the game is forcibly + * saved (via SIGHUP/window close). +**/ + +#ifndef UNCANCEL_H +#define UNCANCEL_H + +void add_uncancel(uncancellable_type kind, int arg = 0); +void run_uncancels(); + +static inline void run_uncancel(uncancellable_type kind, int arg = 0) +{ + add_uncancel(kind, arg); + run_uncancels(); +} + +#endif |