Paxel: Ignore vertical distance, lower dist limit (#883)

* Paxel: Ignore vertical distance, lower dist. limit

* Update medic.lua

Co-authored-by: LoneWolfHT <lonewolf04361@gmail.com>
This commit is contained in:
Lars Müller 2021-06-20 00:07:26 +02:00 committed by GitHub
parent ecd8cbb6c7
commit 8c944a57af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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