Core/Creature: Remove empty spell ids from CreatureAddon.auras vector

Close #23969

(cherry picked from commit f20265feaf)
This commit is contained in:
Giacomo Pozzoni
2019-12-16 10:44:50 +01:00
committed by Shauren
parent 73e7719dbf
commit 64eb65cd45

View File

@@ -676,8 +676,7 @@ void ObjectMgr::LoadCreatureTemplateAddons()
creatureAddon.visibilityDistanceType = VisibilityDistanceType(fields[9].GetUInt8());
Tokenizer tokens(fields[10].GetString(), ' ');
uint8 i = 0;
creatureAddon.auras.resize(tokens.size());
creatureAddon.auras.reserve(tokens.size());
for (Tokenizer::const_iterator itr = tokens.begin(); itr != tokens.end(); ++itr)
{
uint32 spellId = uint32(atoul(*itr));
@@ -703,7 +702,7 @@ void ObjectMgr::LoadCreatureTemplateAddons()
continue;
}
creatureAddon.auras[i++] = spellId;
creatureAddon.auras.push_back(spellId);
}
if (creatureAddon.mount)
@@ -1217,8 +1216,7 @@ void ObjectMgr::LoadCreatureAddons()
creatureAddon.visibilityDistanceType = VisibilityDistanceType(fields[9].GetUInt8());
Tokenizer tokens(fields[10].GetString(), ' ');
uint8 i = 0;
creatureAddon.auras.resize(tokens.size());
creatureAddon.auras.reserve(tokens.size());
for (Tokenizer::const_iterator itr = tokens.begin(); itr != tokens.end(); ++itr)
{
uint32 spellId = uint32(atoul(*itr));
@@ -1244,7 +1242,7 @@ void ObjectMgr::LoadCreatureAddons()
continue;
}
creatureAddon.auras[i++] = spellId;
creatureAddon.auras.push_back(spellId);
}
if (creatureAddon.mount)