Core/Spells: Fixed spell effect value truncation when value is a large integer
Port From (https://github.com/TrinityCore/TrinityCore/commit/2d205506bfd3a2bb253db73b121fd147928811ba)
This commit is contained in:
@@ -1827,7 +1827,7 @@ namespace Game.Entities
|
||||
return spellInfo.GetMinRange(!IsHostileTo(target));
|
||||
}
|
||||
|
||||
public float ApplyEffectModifiers(SpellInfo spellInfo, uint effIndex, float value)
|
||||
public double ApplyEffectModifiers(SpellInfo spellInfo, uint effIndex, double value)
|
||||
{
|
||||
Player modOwner = GetSpellModOwner();
|
||||
if (modOwner != null)
|
||||
|
||||
@@ -2765,6 +2765,16 @@ namespace Game.Entities
|
||||
basevalue = (float)(basevalue + totalflat) * totalmul;
|
||||
}
|
||||
|
||||
public void ApplySpellMod(SpellInfo spellInfo, SpellModOp op, ref double basevalue, Spell spell = null)
|
||||
{
|
||||
float totalmul = 1.0f;
|
||||
int totalflat = 0;
|
||||
|
||||
GetSpellModValues(spellInfo, op, spell, basevalue, ref totalflat, ref totalmul);
|
||||
|
||||
basevalue = (double)(basevalue + totalflat) * totalmul;
|
||||
}
|
||||
|
||||
public void GetSpellModValues<T>(SpellInfo spellInfo, SpellModOp op, Spell spell, T baseValue, ref int flat, ref float pct) where T : IComparable
|
||||
{
|
||||
flat = 0;
|
||||
|
||||
Reference in New Issue
Block a user