From 4e37cc114c8201c22c0b99ed05608e35d5fb6c46 Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Wed, 14 Apr 2021 19:06:30 +0200 Subject: [PATCH] Implement out_of_world damage type --- mods/ENVIRONMENT/mcl_void_damage/init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mods/ENVIRONMENT/mcl_void_damage/init.lua b/mods/ENVIRONMENT/mcl_void_damage/init.lua index ee40ed7022..ac39d10bae 100644 --- a/mods/ENVIRONMENT/mcl_void_damage/init.lua +++ b/mods/ENVIRONMENT/mcl_void_damage/init.lua @@ -40,7 +40,6 @@ minetest.register_on_mods_loaded(function() end self._void_timer = 0 - local pos = obj:get_pos() local void, void_deadly = is_in_void(pos) if void_deadly then local ent = obj:get_luaentity() @@ -81,7 +80,7 @@ minetest.register_globalstep(function(dtime) -- Damage enabled, not immortal: Deal void damage (4 HP / 0.5 seconds) if player:get_hp() > 0 then death_msg(player, S("@1 fell into the endless void.", player:get_player_name())) - player:set_hp(player:get_hp() - VOID_DAMAGE) + mcl_util.deal_damage(player, VOID_DAMAGE, {type = "out_of_world"}) end end end