summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/invent.cc
diff options
context:
space:
mode:
authorelliptic <hyperelliptical@gmail.com>2014-03-29 03:35:58 -0400
committerelliptic <hyperelliptical@gmail.com>2014-03-29 03:40:12 -0400
commitdae4556f83d7a5a1d1acda8eb434c20f82ae62f3 (patch)
tree875df42693ca02c3b67c1414b4b765a72064a60f /crawl-ref/source/invent.cc
parent3b3a7b63ad56bfc0d7bc0369aaf750e9b99ced76 (diff)
downloadcrawl-ref-dae4556f83d7a5a1d1acda8eb434c20f82ae62f3.tar.gz
crawl-ref-dae4556f83d7a5a1d1acda8eb434c20f82ae62f3.zip
Fix amulet of faith prompting twice sometimes when removing it (qw).
There were two separate issues that could cause this. First, when wearing at least one ring as well as the amulet, it would give the prompt once when choosing the amulet to remove and then again when actually removing it. Second, prompts were sometimes checked right before calling remove_ring() and then again inside remove_ring(), for instance when swapping to a different amulet. I think this fixes it without breaking anything else.
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r--crawl-ref/source/invent.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 2c678854b4..e94398e641 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -1882,7 +1882,8 @@ int prompt_invent_item(const char *prompt,
int excluded_slot,
int *const count,
operation_types oper,
- bool allow_list_known)
+ bool allow_list_known,
+ bool do_warning)
{
if (!any_items_to_select(type_expect, false, excluded_slot)
&& type_expect == OSEL_THROWABLE
@@ -2005,7 +2006,7 @@ int prompt_invent_item(const char *prompt,
if (res != -1)
{
ret = res;
- if (check_warning_inscriptions(you.inv[ret], oper))
+ if (!do_warning || check_warning_inscriptions(you.inv[ret], oper))
break;
}
}
@@ -2028,7 +2029,7 @@ int prompt_invent_item(const char *prompt,
if (must_exist && !you.inv[ret].defined())
mpr("You don't have any such object.");
- else if (check_warning_inscriptions(you.inv[ret], oper))
+ else if (!do_warning || check_warning_inscriptions(you.inv[ret], oper))
break;
}
else if (!isspace(keyin))