summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/shopping.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/shopping.cc')
-rw-r--r--crawl-ref/source/shopping.cc27
1 files changed, 26 insertions, 1 deletions
diff --git a/crawl-ref/source/shopping.cc b/crawl-ref/source/shopping.cc
index d69444caee..8f41ed4fce 100644
--- a/crawl-ref/source/shopping.cc
+++ b/crawl-ref/source/shopping.cc
@@ -1612,6 +1612,27 @@ unsigned int item_value( item_def item, id_arr id, bool ident )
return (valued);
} // end item_value()
+// 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;
+};
+
void shop(void)
{
unsigned char i = 0;
@@ -1632,7 +1653,11 @@ void shop(void)
save_id(identy);
- in_a_shop(i, identy);
+ {
+ shopping_hup_protect shp;
+ in_a_shop(i, identy);
+ }
+
you.redraw_gold = 1;
burden_change();