From 3c7233088067a3cb01ec561e645d96313f22055b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 21 May 2017 06:07:23 +0200 Subject: [PATCH] Add exhaust for cactus damage --- mods/PLAYER/playerplus/depends.txt | 1 + mods/PLAYER/playerplus/init.lua | 3 +++ 2 files changed, 4 insertions(+) diff --git a/mods/PLAYER/playerplus/depends.txt b/mods/PLAYER/playerplus/depends.txt index cfa064e27e..5ba88b430c 100644 --- a/mods/PLAYER/playerplus/depends.txt +++ b/mods/PLAYER/playerplus/depends.txt @@ -1,4 +1,5 @@ mcl_init mcl_util mcl_core +mcl_hunger 3d_armor? diff --git a/mods/PLAYER/playerplus/init.lua b/mods/PLAYER/playerplus/init.lua index 9a5a021b26..6bf43da2a4 100644 --- a/mods/PLAYER/playerplus/init.lua +++ b/mods/PLAYER/playerplus/init.lua @@ -115,6 +115,9 @@ minetest.register_globalstep(function(dtime) for _,object in pairs(minetest.get_objects_inside_radius(near, 1.1)) do if object:get_hp() > 0 then object:set_hp(object:get_hp() - 1) + if object:is_player() then + mcl_hunger.exhaust(object:get_player_name(), mcl_hunger.EXHAUST_DAMAGE) + end end end