Skip to content

Commit

Permalink
Fix PLAYER_EVENT_ON_KILLED_BY_CREATURE never being called
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed Jan 1, 2024
1 parent 9bc98a8 commit 9185fb3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/game/Entities/Unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,15 +1163,6 @@ void Unit::Kill(Unit* killer, Unit* victim, DamageEffectType damagetype, SpellEn
if (UnitAI* ai = killer->AI())
ai->KilledUnit(victim);

/*#ifdef BUILD_ELUNA
if (Creature* killer = ToCreature())
{
// used by eluna
if (Player* killed = victim->ToPlayer())
sEluna->OnPlayerKilledByCreature(killer, killed);
}
#endif*/

// Call AI OwnerKilledUnit (for any current summoned minipet/guardian/protector)
killer->PetOwnerKilledUnit(victim);
}
Expand Down Expand Up @@ -1249,6 +1240,15 @@ void Unit::Kill(Unit* killer, Unit* victim, DamageEffectType damagetype, SpellEn
else // Killed creature
JustKilledCreature(killer, static_cast<Creature*>(victim), responsiblePlayer);

#ifdef BUILD_ELUNA
if (Creature* killerCre = killer->ToCreature())
{
// used by eluna
if (Player* killed = victim->ToPlayer())
sEluna->OnPlayerKilledByCreature(killerCre, killed);
}
#endif

// stop combat
DEBUG_FILTER_LOG(LOG_FILTER_DAMAGE, "DealDamageAttackStop");
victim->CombatStop();
Expand Down

0 comments on commit 9185fb3

Please sign in to comment.