From 2197a48974df75e5f54c9819d7f6b9840c6e1616 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 21 May 2017 05:31:30 +0200 Subject: [PATCH] Add TNT explosion damage exhaust --- mods/ITEMS/mcl_tnt/depends.txt | 1 + mods/ITEMS/mcl_tnt/init.lua | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_tnt/depends.txt b/mods/ITEMS/mcl_tnt/depends.txt index eec31c2bb0..34027a62c3 100644 --- a/mods/ITEMS/mcl_tnt/depends.txt +++ b/mods/ITEMS/mcl_tnt/depends.txt @@ -1,4 +1,5 @@ mcl_core mcl_sounds mcl_fire +mcl_hunger doc_identifier? diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index 1f540e3a83..a9ded8045e 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -24,8 +24,9 @@ local function do_tnt_physics(tnt_np,tntr) if v ~= nil then obj:setvelocity({x=(p.x - tnt_np.x) + (tntr / 4) + v.x, y=(p.y - tnt_np.y) + (tntr / 2) + v.y, z=(p.z - tnt_np.z) + (tntr / 4) + v.z}) else - if obj:get_player_name() ~= nil then + if obj:is_player() ~= nil then obj:set_hp(obj:get_hp() - 1) + mcl_hunger.exhaust(obj:get_player_name(), mcl_hunger.EXHAUST_DAMAGE) end end end