summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/exercise.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2011-09-21 15:40:32 +0000
committerRaphael Langella <raphael.langella@gmail.com>2011-09-21 22:28:29 +0200
commit9c43462fc1c278d1dd1f8d762b823e2df54beb3d (patch)
tree997e603cb7f90a16530ecb0c8c6de67156830b4f /crawl-ref/source/exercise.cc
parent080a45ce3f7528ba7d7a4814545efd3ea583e725 (diff)
downloadcrawl-ref-9c43462fc1c278d1dd1f8d762b823e2df54beb3d.tar.gz
crawl-ref-9c43462fc1c278d1dd1f8d762b823e2df54beb3d.zip
Don't exercise armour if EVP is null.
The exercise check is based on armour mass. Any armour heavier than animal skin has a chance off exercising armour. This change only affect steam dragon armour which is slightly heavier than animal skin but still has an EVP of 0.
Diffstat (limited to 'crawl-ref/source/exercise.cc')
-rw-r--r--crawl-ref/source/exercise.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/exercise.cc b/crawl-ref/source/exercise.cc
index 927c9e451f..3189ac441a 100644
--- a/crawl-ref/source/exercise.cc
+++ b/crawl-ref/source/exercise.cc
@@ -260,6 +260,10 @@ static bool _check_train_armour(int amount)
{
if (const item_def *armour = you.slot_item(EQ_BODY_ARMOUR, false))
{
+ // Don't train armour if we have no EVP.
+ if (!property(*armour, PARM_EVASION))
+ return (false);
+
// XXX: animal skin; should be a better way to get at that.
const int mass_base = 100;
const int mass = std::max(item_mass(*armour) - mass_base, 0);