diff --git a/src/game/Entities/Unit.cpp b/src/game/Entities/Unit.cpp index 4981c13ea6..2789ec80d1 100644 --- a/src/game/Entities/Unit.cpp +++ b/src/game/Entities/Unit.cpp @@ -1158,6 +1158,15 @@ void Unit::Kill(Unit* killer, Unit* victim, DamageEffectType damagetype, SpellEn if (killer) { +#ifdef BUILD_ELUNA + if (Creature* killerCre = killer->ToCreature()) + { + // used by eluna + if (Player* killed = victim->ToPlayer()) + sEluna->OnPlayerKilledByCreature(killerCre, killed); + } +#endif + // Call KilledUnit for creatures if (UnitAI* ai = killer->AI()) ai->KilledUnit(victim); @@ -1239,15 +1248,6 @@ void Unit::Kill(Unit* killer, Unit* victim, DamageEffectType damagetype, SpellEn else // Killed creature JustKilledCreature(killer, static_cast(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();