mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Revert 81fea2d7b5.
This commit is contained in:
@@ -861,10 +861,6 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
|
||||
|
||||
// Everything looks OK, create new pet
|
||||
Pet* pet = new Pet(player, HUNTER_PET);
|
||||
|
||||
if (!pet)
|
||||
return false;
|
||||
|
||||
if (!pet->CreateBaseAtCreature(creatureTarget))
|
||||
{
|
||||
delete pet;
|
||||
|
||||
@@ -3823,10 +3823,7 @@ void Spell::EffectTameCreature(SpellEffIndex /*effIndex*/)
|
||||
|
||||
Pet* pet = m_caster->CreateTamedPetFrom(creatureTarget, m_spellInfo->Id);
|
||||
if (!pet) // in very specific state like near world end/etc.
|
||||
{
|
||||
delete pet;
|
||||
return;
|
||||
}
|
||||
|
||||
// "kill" original creature
|
||||
creatureTarget->DespawnOrUnsummon();
|
||||
@@ -7012,10 +7009,7 @@ void Spell::EffectCreateTamedPet(SpellEffIndex effIndex)
|
||||
uint32 creatureEntry = m_spellInfo->Effects[effIndex].MiscValue;
|
||||
Pet* pet = unitTarget->CreateTamedPetFrom(creatureEntry, m_spellInfo->Id);
|
||||
if (!pet)
|
||||
{
|
||||
delete pet;
|
||||
return;
|
||||
}
|
||||
|
||||
// add to world
|
||||
pet->GetMap()->AddToMap(pet->ToCreature());
|
||||
|
||||
@@ -1126,12 +1126,11 @@ public:
|
||||
}
|
||||
|
||||
// Everything looks OK, create new pet
|
||||
Pet* pet = player->CreateTamedPetFrom (creatureTarget);
|
||||
Pet* pet = player->CreateTamedPetFrom(creatureTarget);
|
||||
if (!pet)
|
||||
{
|
||||
handler->PSendSysMessage (LANG_CREATURE_NON_TAMEABLE, cInfo->Entry);
|
||||
handler->SetSentErrorMessage (true);
|
||||
delete pet;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user