diff options
-rw-r--r-- | src/server/game/Entities/Object/Object.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Entities/Object/Object.h | 2 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 10 |
4 files changed, 12 insertions, 8 deletions
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index cca7c5fe890..e833ae78f2c 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2272,7 +2272,7 @@ float WorldObject::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const return spellInfo->GetMinRange(!IsHostileTo(target)); } -float WorldObject::ApplyEffectModifiers(SpellInfo const* spellInfo, uint8 effIndex, float value) const +double WorldObject::ApplyEffectModifiers(SpellInfo const* spellInfo, uint8 effIndex, double value) const { if (Player* modOwner = GetSpellModOwner()) { @@ -2294,6 +2294,8 @@ float WorldObject::ApplyEffectModifiers(SpellInfo const* spellInfo, uint8 effInd case EFFECT_4: modOwner->ApplySpellMod(spellInfo, SpellModOp::PointsIndex4, value); break; + default: + break; } } return value; diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index f409b13c626..6269bc1b975 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -599,7 +599,7 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation float GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const; float GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const; - float ApplyEffectModifiers(SpellInfo const* spellInfo, uint8 effIndex, float value) const; + double ApplyEffectModifiers(SpellInfo const* spellInfo, uint8 effIndex, double value) const; int32 CalcSpellDuration(SpellInfo const* spellInfo) const; int32 ModSpellDuration(SpellInfo const* spellInfo, WorldObject const* target, int32 duration, bool positive, uint32 effectMask) const; void ModSpellCastTime(SpellInfo const* spellInfo, int32& castTime, Spell* spell = nullptr) const; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index e2cdadfb468..c49dc685bc0 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21455,6 +21455,7 @@ void Player::GetSpellModValues(SpellInfo const* spellInfo, SpellModOp op, Spell* template TC_GAME_API void Player::GetSpellModValues(SpellInfo const* spellInfo, SpellModOp op, Spell* spell, int32 base, int32* flat, float* pct) const; template TC_GAME_API void Player::GetSpellModValues(SpellInfo const* spellInfo, SpellModOp op, Spell* spell, uint32 base, int32* flat, float* pct) const; template TC_GAME_API void Player::GetSpellModValues(SpellInfo const* spellInfo, SpellModOp op, Spell* spell, float base, int32* flat, float* pct) const; +template TC_GAME_API void Player::GetSpellModValues(SpellInfo const* spellInfo, SpellModOp op, Spell* spell, double base, int32* flat, float* pct) const; template <class T> void Player::ApplySpellMod(SpellInfo const* spellInfo, SpellModOp op, T& basevalue, Spell* spell /*= nullptr*/) const @@ -21464,12 +21465,13 @@ void Player::ApplySpellMod(SpellInfo const* spellInfo, SpellModOp op, T& baseval GetSpellModValues(spellInfo, op, spell, basevalue, &totalflat, &totalmul); - basevalue = T(float(basevalue + totalflat) * totalmul); + basevalue = T(double(basevalue + totalflat) * totalmul); } template TC_GAME_API void Player::ApplySpellMod(SpellInfo const* spellInfo, SpellModOp op, int32& basevalue, Spell* spell) const; template TC_GAME_API void Player::ApplySpellMod(SpellInfo const* spellInfo, SpellModOp op, uint32& basevalue, Spell* spell) const; template TC_GAME_API void Player::ApplySpellMod(SpellInfo const* spellInfo, SpellModOp op, float& basevalue, Spell* spell) const; +template TC_GAME_API void Player::ApplySpellMod(SpellInfo const* spellInfo, SpellModOp op, double& basevalue, Spell* spell) const; void Player::AddSpellMod(SpellModifier* mod, bool apply) { diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index fa6221427bb..910f9e3da5c 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -479,11 +479,11 @@ bool SpellEffectInfo::IsUnitOwnedAuraEffect() const int32 SpellEffectInfo::CalcValue(WorldObject const* caster /*= nullptr*/, int32 const* bp /*= nullptr*/, Unit const* target /*= nullptr*/, float* variance /*= nullptr*/, uint32 castItemId /*= 0*/, int32 itemLevel /*= -1*/) const { - float basePointsPerLevel = RealPointsPerLevel; + double basePointsPerLevel = RealPointsPerLevel; // TODO: this needs to be a float, not rounded int32 basePoints = CalcBaseValue(caster, target, castItemId, itemLevel); - float value = bp ? *bp : basePoints; - float comboDamage = PointsPerResource; + double value = bp ? *bp : basePoints; + double comboDamage = PointsPerResource; Unit const* casterUnit = nullptr; if (caster) @@ -492,8 +492,8 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster /*= nullptr*/, int32 if (Scaling.Variance) { float delta = fabs(Scaling.Variance * 0.5f); - float valueVariance = frand(-delta, delta); - value += basePoints * valueVariance; + double valueVariance = frand(-delta, delta); + value += double(basePoints) * valueVariance; if (variance) *variance = valueVariance; |