diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-08-17 09:19:43 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-31 00:18:48 +0100 |
commit | 48d491ae2ffbebc05aae46cad2c012a4e983fb11 (patch) | |
tree | 5a9f5681e66aff8f71120d16900e5d7a749f9137 | |
parent | ca92686b44cc8c53a8991bf02d6e8534797fc115 (diff) |
Core/Spells: Fix summoning SUMMON_PET type pets
Closes #25265
(cherry picked from commit 9c5876d8abdc71830c5eb12a6ed036621df4bd6e)
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 4fd9582b1e8..c6013ea0e68 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6005,22 +6005,25 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32 return SPELL_FAILED_DONT_REPORT; } - if (info.first->Type == HUNTER_PET && !info.first->Health) + if (info.first->Type == HUNTER_PET) { - playerCaster->SendTameFailure(PetTameResult::Dead); - return SPELL_FAILED_DONT_REPORT; - } + if (!info.first->Health) + { + playerCaster->SendTameFailure(PetTameResult::Dead); + return SPELL_FAILED_DONT_REPORT; + } - CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(info.first->CreatureId); - if (!creatureInfo || !creatureInfo->IsTameable(playerCaster->CanTameExoticPets())) - { - // if problem in exotic pet - if (creatureInfo && creatureInfo->IsTameable(true)) - playerCaster->SendTameFailure(PetTameResult::CantControlExotic); - else - playerCaster->SendTameFailure(PetTameResult::NoPetAvailable); + CreatureTemplate const* creatureInfo = sObjectMgr->GetCreatureTemplate(info.first->CreatureId); + if (!creatureInfo || !creatureInfo->IsTameable(playerCaster->CanTameExoticPets())) + { + // if problem in exotic pet + if (creatureInfo && creatureInfo->IsTameable(true)) + playerCaster->SendTameFailure(PetTameResult::CantControlExotic); + else + playerCaster->SendTameFailure(PetTameResult::NoPetAvailable); - return SPELL_FAILED_DONT_REPORT; + return SPELL_FAILED_DONT_REPORT; + } } } |