summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-27 10:19:10 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-27 10:19:10 +0000
commitb19f925267a1ee3e3a96382220c87a8ea0efd20e (patch)
tree788511bc98bb9e7aead55386aadc68b09ce68632
parentf4395a55e78d890c8af05b57be215cb695a184c3 (diff)
downloadcrawl-ref-b19f925267a1ee3e3a96382220c87a8ea0efd20e.tar.gz
crawl-ref-b19f925267a1ee3e3a96382220c87a8ea0efd20e.zip
Trunk->0.3 merge (2617-2618): fixed targeting macros and !R confirmation.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2619 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/direct.cc9
-rw-r--r--crawl-ref/source/invent.cc30
-rw-r--r--crawl-ref/source/item_use.cc6
3 files changed, 40 insertions, 5 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index b58a93f87c..24c6939f11 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -487,7 +487,8 @@ void direction(dist& moves, targeting_type restricts,
}
else
{
- flush_input_buffer(FLUSH_ON_FAILURE);
+ if (!skip_iter)
+ flush_input_buffer(FLUSH_ON_FAILURE);
}
break;
@@ -556,7 +557,8 @@ void direction(dist& moves, targeting_type restricts,
}
else
{
- flush_input_buffer(FLUSH_ON_FAILURE);
+ if (!skip_iter)
+ flush_input_buffer(FLUSH_ON_FAILURE);
}
break;
@@ -571,7 +573,8 @@ void direction(dist& moves, targeting_type restricts,
}
else
{
- flush_input_buffer(FLUSH_ON_FAILURE);
+ if (!skip_iter)
+ flush_input_buffer(FLUSH_ON_FAILURE);
}
break;
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 2e0fd1164b..3a578f3784 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -1073,15 +1073,41 @@ static bool check_old_item_warning( const item_def& item,
return yesno(prompt.c_str(), false, 'n');
}
+static std::string operation_verb(operation_types oper)
+{
+ switch (oper)
+ {
+ case OPER_WIELD: return "wield";
+ case OPER_QUAFF: return "quaff";
+ case OPER_DROP: return "drop";
+ case OPER_EAT: return "eat";
+ case OPER_TAKEOFF: return "take off";
+ case OPER_WEAR: return "wear";
+ case OPER_PUTON: return "put on";
+ case OPER_REMOVE: return "remove";
+ case OPER_READ: return "read";
+ case OPER_MEMORISE: return "memorise from";
+ case OPER_ZAP: return "zap";
+ case OPER_THROW: return "throw";
+ case OPER_EXAMINE: return "examine";
+ case OPER_FIRE: return "fire";
+ case OPER_PRAY: return "sacrifice";
+ case OPER_EVOKE: return "evoke";
+ case OPER_ANY:
+ default:
+ return "choose";
+ }
+}
+
/* return true if user OK'd it (or no warning), false otherwise */
bool check_warning_inscriptions( const item_def& item,
operation_types oper )
{
if (is_valid_item( item ) && has_warning_inscription(item, oper) )
{
- std::string prompt = "Really choose ";
+ std::string prompt = "Really " + operation_verb(oper) + " ";
prompt += item.name(DESC_INVENTORY);
- prompt += '?';
+ prompt += "? ";
return (yesno(prompt.c_str(), false, 'n')
&& check_old_item_warning(item, oper));
}
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 94be68527c..2013de262f 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2763,6 +2763,12 @@ bool remove_ring(int slot, bool announce)
return (false);
}
}
+ else if (!check_warning_inscriptions(you.inv[you.equip[hand_used]],
+ OPER_REMOVE))
+ {
+ canned_msg(MSG_OK);
+ return (false);
+ }
if (you.equip[EQ_GLOVES] != -1
&& item_cursed( you.inv[you.equip[EQ_GLOVES]] )