From 701f0d3bae53d22d476eeec3d85ee02a26623a66 Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Fri, 25 Dec 2009 11:10:30 +1000 Subject: Make auto-travel killing toadstools saner. Use wielded_weapon_check, though in this instance do not print a prompt. This means that if you have previously been asked about your weapon and say yes, it will kill toadstools while autoexploring. This means no more "Really attack while wielding your bow?" prompts, and it also should obey no-attack/etc inscriptions. --- crawl-ref/source/fight.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 3ddd3ba835..1543ddabb1 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -5670,7 +5670,7 @@ int melee_attack::mons_to_hit() /////////////////////////////////////////////////////////////////////////// -static bool wielded_weapon_check(const item_def *weapon) +bool wielded_weapon_check(item_def *weapon, bool no_message) { bool weapon_warning = false; bool unarmed_warning = false; @@ -5694,6 +5694,9 @@ static bool wielded_weapon_check(const item_def *weapon) if (!you.received_weapon_warning && !you.confused() && (weapon_warning || unarmed_warning)) { + if (no_message) + return (false); + std::string prompt = "Really attack while "; if (unarmed_warning) prompt += "being unarmed?"; -- cgit v1.2.3-54-g00ecf