summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/food.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-24 11:30:19 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-24 11:30:19 +0000
commit39caa17307d47a3f0eb96a1987649685f4a40686 (patch)
treef312c6c251e19baa4d056b4165749ffb7a640a77 /crawl-ref/source/food.cc
parent111787503763e9d3eeb4eef2248926bf4a4eeb98 (diff)
downloadcrawl-ref-39caa17307d47a3f0eb96a1987649685f4a40686.tar.gz
crawl-ref-39caa17307d47a3f0eb96a1987649685f4a40686.zip
Don't allow switching to autocurse weapons for butchery. [2026147]
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6670 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r--crawl-ref/source/food.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 15418e0032..487a1763f8 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -47,6 +47,7 @@
#include "mutation.h"
#include "output.h"
#include "player.h"
+#include "randart.h"
#include "religion.h"
#include "skills2.h"
#include "spells2.h"
@@ -208,17 +209,21 @@ static int _find_butchering_implement(int &butcher_tool)
// Look for a butchering implement in your pack.
for (int i = 0; i < ENDOFPACK; ++i)
{
- if (is_valid_item( you.inv[i] )
- && you.inv[i].base_type == OBJ_WEAPONS
- && can_cut_meat( you.inv[i] )
- && can_wield( &you.inv[i] ))
+ const item_def& tool(you.inv[i]);
+ if (is_valid_item( tool )
+ && tool.base_type == OBJ_WEAPONS
+ && can_cut_meat( tool )
+ && can_wield( &tool )
+ // Don't even suggest autocursing items.
+ && (!is_random_artefact(tool)
+ || !randart_known_wpn_property(tool, RAP_CURSED)))
{
if (Options.easy_butcher
- && item_known_uncursed(you.inv[i])
- && item_type_known(you.inv[i])
- && get_weapon_brand(you.inv[i]) != SPWPN_DISTORTION
+ && item_known_uncursed(tool)
+ && item_type_known(tool)
+ && get_weapon_brand(tool) != SPWPN_DISTORTION
// Don't even ask!
- && !has_warning_inscription(you.inv[i], OPER_WIELD))
+ && !has_warning_inscription(tool, OPER_WIELD))
{
butcher_tool = i;
return (true);