Core/Auras: fixed off by one error in counting SPELL_ATTR5_START_PERIODIC_AT_APPLY ticks

Port From (https://github.com/TrinityCore/TrinityCore/commit/794a3e43887d3fea4bb9b1ec77a98ab596eea0be)
This commit is contained in:
hondacrx
2021-03-17 16:56:24 -04:00
parent 4fa6122106
commit 1be0e4a685
2 changed files with 42 additions and 24 deletions
+9 -5
View File
@@ -2652,9 +2652,8 @@ namespace Game.Spells
public uint GetMaxTicks()
{
uint totalTicks = 0;
int DotDuration = GetDuration();
if (DotDuration == 0)
return 1;
foreach (SpellEffectInfo effect in _effects)
{
@@ -2676,14 +2675,19 @@ namespace Game.Spells
case AuraType.PeriodicTriggerSpell:
case AuraType.PeriodicTriggerSpellWithValue:
case AuraType.PeriodicHealthFunnel:
if (effect.ApplyAuraPeriod != 0)
return (uint)(DotDuration / effect.ApplyAuraPeriod);
// skip infinite periodics
if (effect.ApplyAuraPeriod > 0 && DotDuration > 0)
{
totalTicks = (uint)DotDuration / effect.ApplyAuraPeriod;
if (HasAttribute(SpellAttr5.StartPeriodicAtApply))
++totalTicks;
}
break;
}
}
}
return 6;
return totalTicks;
}
public uint GetRecoveryTime()