aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXanadu <none@none>2010-01-21 02:02:35 +0100
committerXanadu <none@none>2010-01-21 02:02:35 +0100
commit01bb79cc7d11449a916b628e5d4c7145bb22f225 (patch)
treee08a9c79e6a417e26f053f44c667c1804b28aabd
parent9e91fc997c5606cb09614aa7ff8fec87ffccd21b (diff)
Fix SPELLMOD_PCT spell mods to stack in a truly multiplicative way
--HG-- branch : trunk
-rw-r--r--src/game/Player.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/game/Player.h b/src/game/Player.h
index 208f5d990d4..f82f4848414 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -2590,7 +2590,7 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
{
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
if (!spellInfo) return 0;
- int32 totalpct = 0;
+ float totalmul = 1.0f;
int32 totalflat = 0;
// Drop charges for triggering spells instead of triggered ones
@@ -2620,12 +2620,12 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
if( mod->op==SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100)
continue;
- totalpct += mod->value;
+ totalmul *= 1.0f + (float)mod->value / 100.0f;
}
DropModCharge(mod, spell);
}
- float diff = (float)basevalue*(float)totalpct/100.0f + (float)totalflat;
+ float diff = (float)basevalue * (totalmul - 1.0f) + (float)totalflat;
basevalue = T((float)basevalue + diff);
return T(diff);
}