summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-cast.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-08-28 16:32:54 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-08-28 16:32:54 +0000
commit36d43983b6cc312fefe3a2e67db91f5235084155 (patch)
tree025209ea077c51b64dbbfc842db62ce5ed168e29 /crawl-ref/source/spl-cast.cc
parentbaf36321bb2a9957984012e6101e9bfc41457d4f (diff)
downloadcrawl-ref-36d43983b6cc312fefe3a2e67db91f5235084155.tar.gz
crawl-ref-36d43983b6cc312fefe3a2e67db91f5235084155.zip
Fix 2073715: stave type not IDing from combat.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6866 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r--crawl-ref/source/spl-cast.cc19
1 files changed, 6 insertions, 13 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index aec70f124f..d3ff4048d3 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -439,9 +439,6 @@ int spell_fail(spell_type spell)
int calc_spell_power(spell_type spell, bool apply_intel, bool fail_rate_check)
{
- unsigned int bit;
- int ndx;
-
// When checking failure rates, wizardry is handled after the various
// stepping calulations.
int power = (you.skills[SK_SPELLCASTING] / 2)
@@ -456,15 +453,11 @@ int calc_spell_power(spell_type spell, bool apply_intel, bool fail_rate_check)
int skillcount = count_bits( disciplines );
if (skillcount)
{
- for (ndx = 0; ndx <= SPTYP_LAST_EXPONENT; ndx++)
+ for (int ndx = 0; ndx <= SPTYP_LAST_EXPONENT; ndx++)
{
- bit = 1 << ndx;
- if ((bit != SPTYP_HOLY) && (disciplines & bit))
- {
- int skill = spell_type2skill( bit );
-
- power += (you.skills[skill] * 2) / skillcount;
- }
+ unsigned int bit = (1 << ndx);
+ if (disciplines & bit)
+ power += (you.skills[spell_type2skill(bit)] * 2) / skillcount;
}
}
@@ -478,7 +471,7 @@ int calc_spell_power(spell_type spell, bool apply_intel, bool fail_rate_check)
if (enhanced > 0)
{
- for (ndx = 0; ndx < enhanced; ndx++)
+ for (int i = 0; i < enhanced; i++)
{
power *= 15;
power /= 10;
@@ -486,7 +479,7 @@ int calc_spell_power(spell_type spell, bool apply_intel, bool fail_rate_check)
}
else if (enhanced < 0)
{
- for (ndx = enhanced; ndx < 0; ndx++)
+ for (int i = enhanced; i < 0; i++)
power /= 2;
}