mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-16 16:11:06 +01:00
Merge pull request 'Make sweet berries' velocity checks for damage conditions use absolute values.' (#3308) from CyberMango/MineClone2:dev/mango/make_berries_velocity_check_absolute into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/3308 Reviewed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
This commit is contained in:
commit
86e480aad0
1 changed files with 1 additions and 1 deletions
|
@ -107,7 +107,7 @@ local function berry_damage_check(obj)
|
||||||
if not p then return end
|
if not p then return end
|
||||||
if not minetest.find_node_near(p,0.4,{"group:sweet_berry_thorny"},true) 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()
|
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"})
|
mcl_util.deal_damage(obj, 0.5, {type = "sweet_berry"})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue