summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-07 21:04:21 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-07 21:04:21 +0000
commitd68263bae2edfe29b3028ff90e9d44d35573ce72 (patch)
treefbadd6f0c757c88bc166bf92de2e47457f0d92e3 /crawl-ref
parent7b6908cbb53c4d9b105857e1fdf611596b9a6be4 (diff)
downloadcrawl-ref-d68263bae2edfe29b3028ff90e9d44d35573ce72.tar.gz
crawl-ref-d68263bae2edfe29b3028ff90e9d44d35573ce72.zip
When drawing cards from decks in your inventory, make sure only decks
are offered as choices. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4914 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/decks.cc2
-rw-r--r--crawl-ref/source/invent.cc3
-rw-r--r--crawl-ref/source/invent.h3
3 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 7914856c6e..aa83140bd4 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -708,7 +708,7 @@ static bool _check_buggy_deck(item_def& deck)
static int _choose_inventory_deck( const char* prompt )
{
const int slot = prompt_invent_item( prompt,
- MT_INVLIST, OBJ_MISCELLANY,
+ MT_INVLIST, OSEL_DRAW_DECK,
true, true, true, 0, NULL,
OPER_EVOKE );
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 0674a06890..ad6665baf2 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -30,6 +30,7 @@
#include "externs.h"
#include "clua.h"
+#include "decks.h"
#include "describe.h"
#include "food.h"
#include "initfile.h"
@@ -781,6 +782,8 @@ static bool _item_class_selected(const item_def &i, int selector)
case OSEL_VAMP_EAT:
return (itype == OBJ_CORPSES && i.sub_type == CORPSE_BODY
&& !food_is_rotten(i) && mons_has_blood(i.plus));
+ case OSEL_DRAW_DECK:
+ return (is_deck(i));
case OSEL_EQUIP:
for (int eq = 0; eq < NUM_EQUIP; eq++)
{
diff --git a/crawl-ref/source/invent.h b/crawl-ref/source/invent.h
index 74ac810a85..ad2fa005b5 100644
--- a/crawl-ref/source/invent.h
+++ b/crawl-ref/source/invent.h
@@ -29,7 +29,8 @@ enum object_selector
OSEL_MEMORISE = -5,
OSEL_RECHARGE = -6,
OSEL_ENCH_ARM = -7,
- OSEL_VAMP_EAT = -8
+ OSEL_VAMP_EAT = -8,
+ OSEL_DRAW_DECK = -9
};
#define PROMPT_ABORT -1