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 Nov 22, 2023
1 parent 3bad700 commit 1f7c5ba
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 @@ -1162,15 +1162,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 @@ -1248,6 +1239,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 1f7c5ba

Please sign in to comment.