aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Object
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-12-14 00:24:24 +0100
committerShauren <shauren.trinity@gmail.com>2022-12-14 00:24:24 +0100
commit2d205506bfd3a2bb253db73b121fd147928811ba (patch)
tree27776a348e064a17dbf9abc821355010bedd514b /src/server/game/Entities/Object
parente98e1283ea0034baf6be9aa2ffb386eb5582801b (diff)
Core/Spells: Fixed spell effect value truncation when value is a large integer
Diffstat (limited to 'src/server/game/Entities/Object')
-rw-r--r--src/server/game/Entities/Object/Object.cpp4
-rw-r--r--src/server/game/Entities/Object/Object.h2
2 files changed, 4 insertions, 2 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;