Core/Pet: Fix an issue that was causing lower ranks of pet spells to remain in DB

Port From (https://github.com/TrinityCore/TrinityCore/commit/5e3170d58e82693e7ceb29d4d9c5346906bdd98b)
This commit is contained in:
hondacrx
2020-08-24 11:18:57 -04:00
parent 7cf9b6183e
commit 1b33551fab
+4 -6
View File
@@ -1028,11 +1028,10 @@ namespace Game.Entities
if (petSpell != null) if (petSpell != null)
{ {
if (petSpell.state == PetSpellState.Removed) if (petSpell.state == PetSpellState.Removed)
{
m_spells.Remove(spellId);
state = PetSpellState.Changed; state = PetSpellState.Changed;
} else
else if (state == PetSpellState.Unchanged && petSpell.state != PetSpellState.Unchanged) {
if (state == PetSpellState.Unchanged && petSpell.state != PetSpellState.Unchanged)
{ {
// can be in case spell loading but learned at some previous spell loading // can be in case spell loading but learned at some previous spell loading
petSpell.state = PetSpellState.Unchanged; petSpell.state = PetSpellState.Unchanged;
@@ -1044,8 +1043,7 @@ namespace Game.Entities
return false; return false;
} }
else }
return false;
} }
PetSpell newspell = new PetSpell(); PetSpell newspell = new PetSpell();