From c57f7972265e153f36620ea3ce1c1f711141646a Mon Sep 17 00:00:00 2001 From: CyberMango Date: Fri, 13 Jan 2023 23:36:43 +0200 Subject: [PATCH] Make the velocity checks absolute. Now sweet berries will cause damage in all directions. --- mods/ITEMS/mcl_farming/sweet_berry.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_farming/sweet_berry.lua b/mods/ITEMS/mcl_farming/sweet_berry.lua index 8a91c0e79..7dc6326a4 100644 --- a/mods/ITEMS/mcl_farming/sweet_berry.lua +++ b/mods/ITEMS/mcl_farming/sweet_berry.lua @@ -107,7 +107,7 @@ local function berry_damage_check(obj) if not p then return end if not minetest.find_node_near(p,0.4,{"group:sweet_berry_thorny"},true) then return end local v = obj:get_velocity() - if v.x < 0.1 and v.y < 0.1 and v.z < 0.1 then return end + if math.abs(v.x) < 0.1 and math.abs(v.y) < 0.1 and math.abs(v.z) < 0.1 then return end mcl_util.deal_damage(obj, 0.5, {type = "sweet_berry"}) end