From b645a2ab673ca868f7b7680f8e461bfa86c27fc2 Mon Sep 17 00:00:00 2001 From: Eliy21 Date: Sun, 21 Jan 2024 09:09:15 +0000 Subject: [PATCH] Remove commented out cactus mob damage code --- mods/ITEMS/mcl_core/nodes_cactuscane.lua | 42 +----------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/mods/ITEMS/mcl_core/nodes_cactuscane.lua b/mods/ITEMS/mcl_core/nodes_cactuscane.lua index 7f5f18966..805385124 100644 --- a/mods/ITEMS/mcl_core/nodes_cactuscane.lua +++ b/mods/ITEMS/mcl_core/nodes_cactuscane.lua @@ -135,44 +135,4 @@ minetest.register_node("mcl_core:reeds", { end, _mcl_blast_resistance = 0, _mcl_hardness = 0, -}) - --- Moved cactus mob damage logic to /ENTITIES/mcl_mobs/physics.lua ---[[ -local function cactus_damage_check(obj, is_mob) - -- where am I? - local pos = obj:get_pos() - if pos then - -- Am I near a cactus? - local near = minetest.find_node_near(pos, 1, "mcl_core:cactus", true) - if not near and near ~= nil then - near = find_node_near({x=pos.x, y=pos.y-1, z=pos.z}, 1, "mcl_core:cactus", true) - end - if near then - -- Am I touching the cactus? If so, it hurts - local dist = vector.distance(pos, near) - local dist_feet = vector.distance({x=pos.x, y=pos.y-1, z=pos.z}, near) - if dist < 1.1 or dist_feet < 1.1 or (is_mob and (dist < 1.25 or dist_feet < 1.9)) then - if obj:get_hp() > 0 then - mcl_util.deal_damage(obj, 1, {type = "cactus"}) - end - end - end - end -end - -local etime = 0 -minetest.register_globalstep(function(dtime) - etime = dtime + etime - if etime < 0.5 then return end - etime = 0 - --for _,pl in pairs(minetest.get_connected_players()) do - --cactus_damage_check(pl) -- Another player cactus damage check code is in mcl_playerplus - --end - for _,ent in pairs(minetest.luaentities) do - if ent.is_mob then - cactus_damage_check(ent.object, true) - end - end -end) -]] \ No newline at end of file +}) \ No newline at end of file