Core/Spells: Fix summoning warlock pets in case that pet has never been summoned before

Port From (https://github.com/TrinityCore/TrinityCore/commit/87b1c3700e8b8e5722b31fef2de124a2f39915c0)
This commit is contained in:
hondacrx
2022-03-10 09:43:23 -05:00
parent 26a3fb92b1
commit 4a97585ee9
+7 -5
View File
@@ -5222,12 +5222,8 @@ namespace Game.Spells
if (playerCaster != null && playerCaster.GetPetStable() != null)
{
var info = Pet.GetLoadPetInfo(playerCaster.GetPetStable(), (uint)spellEffectInfo.MiscValue, 0, false);
if (info.Item1 == null)
if (info.Item1 != null)
{
playerCaster.SendTameFailure(PetTameResult.NoPetAvailable);
return SpellCastResult.DontReport;
}
if (info.Item1.Type == PetType.Hunter)
{
if (info.Item1.Health == 0)
@@ -5249,6 +5245,12 @@ namespace Game.Spells
}
}
}
else if (spellEffectInfo.MiscValue == 0) // when miscvalue is present it is allowed to create new pets
{
playerCaster.SendTameFailure(PetTameResult.NoPetAvailable);
return SpellCastResult.DontReport;
}
}
break;
}
case SpellEffectName.SummonPlayer: