From 861e64fe053b191f2a4eaba83a88e0f1e7760eaf Mon Sep 17 00:00:00 2001 From: Niam5 Date: Thu, 12 Oct 2023 15:49:26 -0500 Subject: [PATCH] Add new environmental death hook -Update Eluna submodule --- src/game/Entities/Player.cpp | 5 +++++ src/game/LuaEngine | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/game/Entities/Player.cpp b/src/game/Entities/Player.cpp index 7f4c315ed3..54a8b88e63 100644 --- a/src/game/Entities/Player.cpp +++ b/src/game/Entities/Player.cpp @@ -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"); diff --git a/src/game/LuaEngine b/src/game/LuaEngine index 46bed6d6be..dc040cc1fa 160000 --- a/src/game/LuaEngine +++ b/src/game/LuaEngine @@ -1 +1 @@ -Subproject commit 46bed6d6be8ecdb7835fcc8305695839f49394d1 +Subproject commit dc040cc1fa76b76b3f45eddec4e929db5b0df9c6