This commit is contained in:
megamage
2011-11-28 14:34:30 -05:00
parent 1f70fd2851
commit 5b034ee631
3 changed files with 1 additions and 12 deletions

View File

@@ -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;

View File

@@ -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());

View File

@@ -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;
}