summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-21 12:02:30 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-21 12:02:30 +0000
commit20e1e61ec9150b594e8478cac1d7932ecc14300b (patch)
treed47a91a3cd42b348165812f831a70c60bafd1852
parent454943c33887d4c92fe23dbd365ec782c015b8d6 (diff)
downloadcrawl-ref-20e1e61ec9150b594e8478cac1d7932ecc14300b.tar.gz
crawl-ref-20e1e61ec9150b594e8478cac1d7932ecc14300b.zip
2026956: only prompt for sharp weapons in butchery.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6963 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/food.cc2
-rw-r--r--crawl-ref/source/invent.cc7
-rw-r--r--crawl-ref/source/invent.h3
3 files changed, 9 insertions, 3 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 902d8db009..85339ceab0 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -236,7 +236,7 @@ static int _find_butchering_implement(int &butcher_tool)
const int item_slot = prompt_invent_item(
"What would you like to use? (- for none)?",
- MT_INVLIST, OSEL_WIELD,
+ MT_INVLIST, OSEL_BUTCHERY,
true, true, true, '-', -1, NULL, OPER_WIELD);
if (prompt_failed(item_slot))
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 453cb4f167..1e4cdf7141 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -361,6 +361,8 @@ static std::string _no_selectables_message(int item_selector)
return("You aren't carrying any wands.");
case OSEL_THROWABLE:
return("You aren't carrying any items that might be thrown or fired.");
+ case OSEL_BUTCHERY:
+ return("You aren't carrying any sharp implements.");
}
return("You aren't carrying any such object.");
@@ -820,6 +822,9 @@ static bool _item_class_selected(const item_def &i, int selector)
return (itype == OBJ_WEAPONS || itype == OBJ_STAVES
|| itype == OBJ_MISCELLANY);
+ case OSEL_BUTCHERY:
+ return (itype == OBJ_WEAPONS && can_cut_meat(i));
+
case OSEL_MEMORISE:
return (itype == OBJ_BOOKS && i.sub_type != BOOK_MANUAL
&& (i.sub_type != BOOK_DESTRUCTION || !item_type_known(i)));
@@ -1326,7 +1331,7 @@ int prompt_invent_item( const char *prompt,
}
if (!_any_items_to_select(type_expect) && type_expect != OSEL_WIELD
- && mtype == MT_INVLIST)
+ && type_expect != OSEL_BUTCHERY && mtype == MT_INVLIST)
{
mprf(MSGCH_PROMPT, "%s",
_no_selectables_message(type_expect).c_str());
diff --git a/crawl-ref/source/invent.h b/crawl-ref/source/invent.h
index 099258336d..8a28bcd942 100644
--- a/crawl-ref/source/invent.h
+++ b/crawl-ref/source/invent.h
@@ -27,7 +27,8 @@ enum object_selector
OSEL_ENCH_ARM = -7,
OSEL_VAMP_EAT = -8,
OSEL_DRAW_DECK = -9,
- OSEL_THROWABLE = -10
+ OSEL_THROWABLE = -10,
+ OSEL_BUTCHERY = -11
};
#define PROMPT_ABORT -1