summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-09 11:52:47 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-09 11:52:47 +0000
commit37b869723d4dc21ae205cd632f016d050f754fcc (patch)
treebcc9cae590590b7fb0d87af68441efdf8fea8729 /crawl-ref/source/item_use.cc
parent197e914235a08d505781e2b75b69998e8452b051 (diff)
downloadcrawl-ref-37b869723d4dc21ae205cd632f016d050f754fcc.tar.gz
crawl-ref-37b869723d4dc21ae205cd632f016d050f754fcc.zip
[1739347] Fixed acquirement giving unwieldable weapons.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1814 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc19
1 files changed, 11 insertions, 8 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 34ee576593..17c5f8d091 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -76,25 +76,28 @@ static bool enchant_armour( void );
// Rather messy - we've gathered all the can't-wield logic from wield_weapon()
// here.
-bool can_wield(const item_def *weapon, bool say_reason)
+bool can_wield(const item_def *weapon, bool say_reason,
+ bool ignore_temporary_disability)
{
#define SAY(x) if (say_reason) { x; } else
- if (you.duration[DUR_BERSERKER])
+ if (!ignore_temporary_disability && you.duration[DUR_BERSERKER])
{
SAY(canned_msg(MSG_TOO_BERSERK));
return false;
}
- if (you.attribute[ATTR_TRANSFORMATION] != TRAN_NONE
- && !can_equip( EQ_WEAPON ))
+ if (!ignore_temporary_disability
+ && you.attribute[ATTR_TRANSFORMATION] != TRAN_NONE
+ && !can_equip( EQ_WEAPON ))
{
SAY(mpr("You can't wield anything in your present form."));
return false;
}
- if (you.equip[EQ_WEAPON] != -1
- && you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_WEAPONS
- && item_cursed( you.inv[you.equip[EQ_WEAPON]] ))
+ if (!ignore_temporary_disability
+ && you.equip[EQ_WEAPON] != -1
+ && you.inv[you.equip[EQ_WEAPON]].base_type == OBJ_WEAPONS
+ && item_cursed( you.inv[you.equip[EQ_WEAPON]] ))
{
SAY(mpr("You can't unwield your weapon to draw a new one!"));
return false;
@@ -113,7 +116,7 @@ bool can_wield(const item_def *weapon, bool say_reason)
}
}
- if (is_shield_incompatible(*weapon))
+ if (!ignore_temporary_disability && is_shield_incompatible(*weapon))
{
SAY(mpr("You can't wield that with a shield."));
return (false);