aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-08-17 11:52:44 +0200
committerShauren <shauren.trinity@gmail.com>2020-08-17 11:52:44 +0200
commitbbcf00257ebdb75fa30f0484cb185058139f8ae4 (patch)
treebce2b043e830e94621624baef4806cbed9b635ac
parent9c5876d8abdc71830c5eb12a6ed036621df4bd6e (diff)
Core/Spells: Fix summoning warlock pets in case that pet has never been summoned before
-rw-r--r--src/server/game/Spells/Spell.cpp42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 1f7e84a729f..11e24e6e8b1 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -5763,32 +5763,34 @@ SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint
if (playerCaster && playerCaster->GetPetStable())
{
std::pair<PetStable::PetInfo const*, PetSaveMode> info = Pet::GetLoadPetInfo(*playerCaster->GetPetStable(), m_spellInfo->Effects[i].MiscValue, 0, false);
- if (!info.first)
+ if (info.first)
{
- playerCaster->SendTameFailure(PETTAME_NOPETAVAILABLE);
- return SPELL_FAILED_DONT_REPORT;
- }
-
- if (info.first->Type == HUNTER_PET)
- {
- if (!info.first->Health)
+ if (info.first->Type == HUNTER_PET)
{
- playerCaster->SendTameFailure(PETTAME_DEAD);
- return SPELL_FAILED_DONT_REPORT;
- }
+ if (!info.first->Health)
+ {
+ playerCaster->SendTameFailure(PETTAME_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(PETTAME_CANTCONTROLEXOTIC);
- else
- playerCaster->SendTameFailure(PETTAME_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(PETTAME_CANTCONTROLEXOTIC);
+ else
+ playerCaster->SendTameFailure(PETTAME_NOPETAVAILABLE);
- return SPELL_FAILED_DONT_REPORT;
+ return SPELL_FAILED_DONT_REPORT;
+ }
}
}
+ else if (!m_spellInfo->Effects[i].MiscValue) // when miscvalue is present it is allowed to create new pets
+ {
+ playerCaster->SendTameFailure(PETTAME_NOPETAVAILABLE);
+ return SPELL_FAILED_DONT_REPORT;
+ }
}
break;