fix(Core/Unit): Fix creatures not being able to cast spells during Ju… (#14957)
This commit is contained in:
parent
43cd34e72e
commit
68c38226ed
1 changed files with 7 additions and 7 deletions
|
|
@ -17852,6 +17852,13 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
|||
isRewardAllowed = creature->IsDamageEnoughForLootingAndReward();
|
||||
if (!isRewardAllowed)
|
||||
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
|
||||
|
|
@ -18074,13 +18081,6 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
|||
if (killer && killer->GetTypeId() == TYPEID_UNIT && killer->IsAIEnabled)
|
||||
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 (WorldObject* summoner = summon->GetSummoner())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue