Core/Spells: Initialize EffectIndex of empty effects to their proper values instead of always being 0
Port From (https://github.com/TrinityCore/TrinityCore/commit/759d2fdd862eb86d022e79adcd3a90374fef58e4)
This commit is contained in:
@@ -45,6 +45,10 @@ namespace Game.Spells
|
||||
_effects[(int)spellEffect.EffectIndex] = new SpellEffectInfo(this, spellEffect);
|
||||
}
|
||||
|
||||
// Correct EffectIndex for blank effects
|
||||
for (int i = 0; i < _effects.Count; ++i)
|
||||
_effects[i].EffectIndex = (uint)i;
|
||||
|
||||
SpellName = spellName.Name;
|
||||
|
||||
SpellMiscRecord _misc = data.Misc;
|
||||
@@ -258,6 +262,10 @@ namespace Game.Spells
|
||||
_effects.EnsureWritableListIndex(spellEffect.EffectIndex, new SpellEffectInfo(this));
|
||||
_effects[(int)spellEffect.EffectIndex] = new SpellEffectInfo(this, spellEffect);
|
||||
}
|
||||
|
||||
// Correct EffectIndex for blank effects
|
||||
for (int i = 0; i < _effects.Count; ++i)
|
||||
_effects[i].EffectIndex = (uint)i;
|
||||
}
|
||||
|
||||
public bool HasEffect(SpellEffectName effect)
|
||||
|
||||
Reference in New Issue
Block a user