summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/shopping.h
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/shopping.h')
-rw-r--r--crawl-ref/source/shopping.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/crawl-ref/source/shopping.h b/crawl-ref/source/shopping.h
index fd33af98f5..39e9c48a4c 100644
--- a/crawl-ref/source/shopping.h
+++ b/crawl-ref/source/shopping.h
@@ -15,6 +15,7 @@
#define SHOPPING_H
#include "externs.h"
+#include "itemname.h"
void shop_init_id_type(int shoptype, id_fix_arr &shop_id);
void shop_uninit_id_type(int shoptype, const id_fix_arr &shop_id);
@@ -45,4 +46,25 @@ const shop_struct *get_shop(int sx, int sy);
* *********************************************************************** */
const char *shop_name(int sx, int sy);
+// Protect the id array against being clobbered by a SIGHUP with the
+// character in a shop.
+extern id_arr shop_backup_id;
+class shopping_hup_protect
+{
+public:
+ shopping_hup_protect() : shopping(crawl_state.shopping)
+ {
+ save_id(shop_backup_id);
+ crawl_state.shopping = true;
+ }
+
+ ~shopping_hup_protect()
+ {
+ crawl_state.shopping = shopping;
+ }
+
+private:
+ bool shopping;
+};
+
#endif