fix(Core/Unit): Fix creatures not being able to cast spells during Ju… (#14957)
This commit is contained in:
@@ -17852,6 +17852,13 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
|||||||
isRewardAllowed = creature->IsDamageEnoughForLootingAndReward();
|
isRewardAllowed = creature->IsDamageEnoughForLootingAndReward();
|
||||||
if (!isRewardAllowed)
|
if (!isRewardAllowed)
|
||||||
creature->SetLootRecipient(nullptr);
|
creature->SetLootRecipient(nullptr);
|
||||||
|
|
||||||
|
// Call creature just died function
|
||||||
|
if (CreatureAI* ai = creature->AI())
|
||||||
|
{
|
||||||
|
ai->JustDied(killer);
|
||||||
|
sScriptMgr->OnUnitDeath(creature, killer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// pussywizard: remade this if section (player is on the same map
|
// pussywizard: remade this if section (player is on the same map
|
||||||
@@ -18074,13 +18081,6 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
|||||||
if (killer && killer->GetTypeId() == TYPEID_UNIT && killer->IsAIEnabled)
|
if (killer && killer->GetTypeId() == TYPEID_UNIT && killer->IsAIEnabled)
|
||||||
killer->ToCreature()->AI()->KilledUnit(victim);
|
killer->ToCreature()->AI()->KilledUnit(victim);
|
||||||
|
|
||||||
// Call creature just died function
|
|
||||||
if (CreatureAI* ai = creature->AI())
|
|
||||||
{
|
|
||||||
ai->JustDied(killer);
|
|
||||||
sScriptMgr->OnUnitDeath(creature, killer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TempSummon* summon = creature->ToTempSummon())
|
if (TempSummon* summon = creature->ToTempSummon())
|
||||||
{
|
{
|
||||||
if (WorldObject* summoner = summon->GetSummoner())
|
if (WorldObject* summoner = summon->GetSummoner())
|
||||||
|
|||||||
Reference in New Issue
Block a user