From 8c944a57afba9a606b980ced1ab29a20d14c4593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Sun, 20 Jun 2021 00:07:26 +0200 Subject: [PATCH] Paxel: Ignore vertical distance, lower dist limit (#883) * Paxel: Ignore vertical distance, lower dist. limit * Update medic.lua Co-authored-by: LoneWolfHT --- mods/ctf/ctf_classes/medic.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/ctf/ctf_classes/medic.lua b/mods/ctf/ctf_classes/medic.lua index 7a198a5..de07c13 100644 --- a/mods/ctf/ctf_classes/medic.lua +++ b/mods/ctf/ctf_classes/medic.lua @@ -138,7 +138,7 @@ minetest.override_item("ctf_bandages:bandage", { local diggers = {} local DIG_COOLDOWN = 30 -local DIG_DIST_LIMIT = 50 +local DIG_DIST_LIMIT = 10 local DIG_SPEED = 0.1 local function isdiggable(name) @@ -171,7 +171,10 @@ local function remove_pillar(pos, pname) minetest.dig_node(pos) if player and diggers[pname] and type(diggers[pname]) ~= "table" then - if vector.distance(player:get_pos(), pos) <= DIG_DIST_LIMIT then + local distance = vector.subtract(player:get_pos(), pos) + -- Ignore vertical distance + distance.y = 0 + if vector.length(distance) <= DIG_DIST_LIMIT then pos.y = pos.y + 1 minetest.after(DIG_SPEED, remove_pillar, pos, pname) else