summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/fight.cc5
-rw-r--r--crawl-ref/source/fight.h1
-rw-r--r--crawl-ref/source/travel.cc4
3 files changed, 9 insertions, 1 deletions
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?";
diff --git a/crawl-ref/source/fight.h b/crawl-ref/source/fight.h
index 70e29f2a02..2bc47bd030 100644
--- a/crawl-ref/source/fight.h
+++ b/crawl-ref/source/fight.h
@@ -60,6 +60,7 @@ bool monster_attack(monsters* attacker, bool allow_unarmed = true);
bool monsters_fight(monsters* attacker, monsters* attacked,
bool allow_unarmed = true);
+bool wielded_weapon_check(item_def *weapon, bool no_message = false);
int calc_your_to_hit(bool random_factor);
int calc_heavy_armour_penalty(bool random_factor);
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 6da7bc6ee0..28b593d97a 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -24,6 +24,7 @@
#include "directn.h"
#include "map_knowledge.h"
#include "exclude.h"
+#include "fight.h"
#include "godabil.h"
#include "itemname.h"
#include "itemprop.h"
@@ -2208,6 +2209,9 @@ static travel_target _prompt_travel_depth(const level_id &id,
bool travel_kill_monster(const monsters * monster)
{
+ if (!wielded_weapon_check(you.weapon(), true))
+ return (false);
+
return (monster->type == MONS_TOADSTOOL);
}