mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: Initialize EffectIndex of empty effects to their proper values instead of always being 0
Closes #27261
This commit is contained in:
@@ -1086,6 +1086,10 @@ SpellInfo::SpellInfo(SpellNameEntry const* spellName, ::Difficulty difficulty, S
|
||||
Trinity::Containers::EnsureWritableVectorIndex(_effects, spellEffect->EffectIndex, SpellEffectInfo(this)) = SpellEffectInfo(this, *spellEffect);
|
||||
}
|
||||
|
||||
// Correct EffectIndex for blank effects
|
||||
for (size_t i = 0; i < _effects.size(); ++i)
|
||||
_effects[i].EffectIndex = SpellEffIndex(i);
|
||||
|
||||
_effects.shrink_to_fit();
|
||||
|
||||
SpellName = &spellName->Name;
|
||||
@@ -1269,6 +1273,10 @@ SpellInfo::SpellInfo(SpellNameEntry const* spellName, ::Difficulty difficulty, s
|
||||
for (SpellEffectEntry const& spellEffect : effects)
|
||||
Trinity::Containers::EnsureWritableVectorIndex(_effects, spellEffect.EffectIndex, SpellEffectInfo(this)) = SpellEffectInfo(this, spellEffect);
|
||||
|
||||
// Correct EffectIndex for blank effects
|
||||
for (size_t i = 0; i < _effects.size(); ++i)
|
||||
_effects[i].EffectIndex = SpellEffIndex(i);
|
||||
|
||||
_effects.shrink_to_fit();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user