summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-04 11:54:17 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-04 11:54:17 +0000
commitf79c9dacc90e9a7880f73abe03565e6d797e20a9 (patch)
treed45f82cff8f90fa33bcafb45a836f72a1d00495e /crawl-ref/source/item_use.cc
parent0bd8cc1203fd6872ed4446be5acbb838e4fb6338 (diff)
downloadcrawl-ref-f79c9dacc90e9a7880f73abe03565e6d797e20a9.tar.gz
crawl-ref-f79c9dacc90e9a7880f73abe03565e6d797e20a9.zip
Implemented Blade card.
Damnation will no longer work in Abyss/Pan/Lab. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1747 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index a5593022d4..f6ee93ef8f 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -747,15 +747,12 @@ bool do_wear_armour( int item, bool quiet )
return (false);
}
- for (int loopy = EQ_CLOAK; loopy <= EQ_BODY_ARMOUR; loopy++)
+ if ( wearing_slot(item) )
{
- if (item == you.equip[loopy])
- {
- if (!quiet)
- mpr("You are already wearing that!");
+ if (!quiet)
+ mpr("You are already wearing that!");
- return (false);
- }
+ return (false);
}
// if you're wielding something,
@@ -1106,13 +1103,10 @@ void throw_anything(void)
}
else
{
- for (int loopy = EQ_CLOAK; loopy <= EQ_AMULET; loopy++)
+ if ( wearing_slot(throw_slot) )
{
- if (throw_slot == you.equip[loopy])
- {
- mpr("You are wearing that object!");
- return;
- }
+ mpr("You are wearing that object!");
+ return;
}
}
@@ -3730,3 +3724,11 @@ void use_randart(const item_def &item)
xom_is_stimulated(256);
}
}
+
+bool wearing_slot(int inv_slot)
+{
+ for (int i = EQ_CLOAK; i <= EQ_AMULET; ++i)
+ if ( inv_slot == you.equip[i] )
+ return true;
+ return false;
+}