Core/Pets: Fixed crash when summoning hunter pets

Port From (https://github.com/TrinityCore/TrinityCore/commit/074c5da6e43796a88ad34e8724362433d5109f88)
This commit is contained in:
hondacrx
2023-07-18 07:51:23 -04:00
parent e4111c7d22
commit fe9519f3b6
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -162,7 +162,11 @@ namespace Game.Entities
if (petInfo.Type == PetType.Hunter)
{
CreatureTemplate creatureInfo = Global.ObjectMgr.GetCreatureTemplate(petInfo.CreatureId);
if (creatureInfo == null || !creatureInfo.IsTameable(owner.CanTameExoticPets(), GetCreatureDifficulty()))
if (creatureInfo == null)
return false;
CreatureDifficulty creatureDifficulty = creatureInfo.GetDifficulty(Difficulty.None);
if (creatureDifficulty == null || !creatureInfo.IsTameable(owner.CanTameExoticPets(), creatureDifficulty))
return false;
}