Core/Spells: Fixes OverflowException for ChainTargets

This commit is contained in:
hondacrx
2018-05-26 13:11:47 -04:00
parent f7e557ab71
commit 41bce64ffc
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -287,7 +287,7 @@ namespace Game.DataStorage
public uint EffectAuraPeriod; public uint EffectAuraPeriod;
public float EffectBonusCoefficient; public float EffectBonusCoefficient;
public float EffectChainAmplitude; public float EffectChainAmplitude;
public uint EffectChainTargets; public int EffectChainTargets;
public int EffectDieSides; public int EffectDieSides;
public uint EffectItemType; public uint EffectItemType;
public uint EffectMechanic; public uint EffectMechanic;
+2 -2
View File
@@ -1019,7 +1019,7 @@ namespace Game.Spells
if (effect == null) if (effect == null)
return; return;
uint maxTargets = effect.ChainTargets; int maxTargets = effect.ChainTargets;
Player modOwner = m_caster.GetSpellModOwner(); Player modOwner = m_caster.GetSpellModOwner();
if (modOwner) if (modOwner)
modOwner.ApplySpellMod(m_spellInfo.Id, SpellModOp.JumpTargets, ref maxTargets, this); modOwner.ApplySpellMod(m_spellInfo.Id, SpellModOp.JumpTargets, ref maxTargets, this);
@@ -1033,7 +1033,7 @@ namespace Game.Spells
m_applyMultiplierMask |= (byte)effMask; m_applyMultiplierMask |= (byte)effMask;
List<WorldObject> targets = new List<WorldObject>(); List<WorldObject> targets = new List<WorldObject>();
SearchChainTargets(targets, maxTargets - 1, target, targetType.GetObjectType(), targetType.GetCheckType(), effect.ImplicitTargetConditions, targetType.GetTarget() == Targets.UnitChainhealAlly); SearchChainTargets(targets, (uint)maxTargets - 1, target, targetType.GetObjectType(), targetType.GetCheckType(), effect.ImplicitTargetConditions, targetType.GetTarget() == Targets.UnitChainhealAlly);
// Chain primary target is added earlier // Chain primary target is added earlier
CallScriptObjectAreaTargetSelectHandlers(targets, effIndex, targetType); CallScriptObjectAreaTargetSelectHandlers(targets, effIndex, targetType);
+1 -1
View File
@@ -4395,7 +4395,7 @@ namespace Game.Spells
public SpellImplicitTargetInfo TargetB; public SpellImplicitTargetInfo TargetB;
public SpellRadiusRecord RadiusEntry; public SpellRadiusRecord RadiusEntry;
public SpellRadiusRecord MaxRadiusEntry; public SpellRadiusRecord MaxRadiusEntry;
public uint ChainTargets; public int ChainTargets;
public uint ItemType; public uint ItemType;
public uint TriggerSpell; public uint TriggerSpell;
public FlagArray128 SpellClassMask; public FlagArray128 SpellClassMask;