Skip to content

Commit

Permalink
Add new environmental death hook
Browse files Browse the repository at this point in the history
-Update Eluna submodule
  • Loading branch information
Niam5 committed Oct 12, 2023
1 parent 4e8e2d1 commit 861e64f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/game/Entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,11 @@ uint32 Player::EnvironmentalDamage(EnvironmentalDamageType type, uint32 damage)

uint32 final_damage = Unit::DealDamage(this, this, damage, nullptr, damageType, SPELL_SCHOOL_MASK_NORMAL, nullptr, false);

#ifdef BUILD_ELUNA
if (!IsAlive())
sEluna->OnPlayerKilledByEnvironment(this, type);
#endif

if (type == DAMAGE_FALL && !IsAlive()) // DealDamage not apply item durability loss at self damage
{
DEBUG_LOG("We are fall to death, loosing 10 percents durability");
Expand Down
2 changes: 1 addition & 1 deletion src/game/LuaEngine

0 comments on commit 861e64f

Please sign in to comment.