Core/Pet: Change assert to error log

Change assert added in 43dec9e4d0 to error log since charmed creatures lose their AI until next map update
This commit is contained in:
jackpoz
2019-04-28 18:47:19 +02:00
parent 37478c5ac1
commit 70fcdc687d

View File

@@ -10943,7 +10943,12 @@ bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
{
Pet* pet = player->GetPet();
if (pet && pet->IsAlive() && pet->isControlled())
ASSERT_NOTNULL(pet->AI())->KilledUnit(victim);
{
if (pet->IsAIEnabled())
pet->AI()->KilledUnit(victim);
else
TC_LOG_ERROR("entities.unit", "Pet doesn't have any AI in Unit::Kill(). %s", pet->GetDebugInfo());
}
}
// 10% durability loss on death