Fix up some minetest.is_protected functions
This commit is contained in:
parent
72d27ca1ce
commit
8c33103e4c
2 changed files with 6 additions and 6 deletions
|
@ -77,9 +77,9 @@ end
|
||||||
local old_is_protected = minetest.is_protected
|
local old_is_protected = minetest.is_protected
|
||||||
local r = ctf.setting("flag.nobuild_radius")
|
local r = ctf.setting("flag.nobuild_radius")
|
||||||
local rs = r * r
|
local rs = r * r
|
||||||
function minetest.is_protected(pos, name)
|
function minetest.is_protected(pos, name, ...)
|
||||||
if r <= 0 or rs == 0 then
|
if r <= 0 or rs == 0 then
|
||||||
return old_is_protected(pos, name)
|
return old_is_protected(pos, name, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
local flag, distSQ = ctf_flag.get_nearest(pos)
|
local flag, distSQ = ctf_flag.get_nearest(pos)
|
||||||
|
@ -88,7 +88,7 @@ function minetest.is_protected(pos, name)
|
||||||
"Too close to the flag to build! Leave at least " .. r .. " blocks around the flag.")
|
"Too close to the flag to build! Leave at least " .. r .. " blocks around the flag.")
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return old_is_protected(pos, name)
|
return old_is_protected(pos, name, ...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -214,9 +214,9 @@ end
|
||||||
|
|
||||||
if minetest.get_modpath("ctf") then
|
if minetest.get_modpath("ctf") then
|
||||||
local old_is_protected = minetest.is_protected
|
local old_is_protected = minetest.is_protected
|
||||||
function minetest.is_protected(pos, name)
|
function minetest.is_protected(pos, name, ...)
|
||||||
if ctf_match.build_timer <= 0 then
|
if ctf_match.build_timer <= 0 then
|
||||||
return old_is_protected(pos, name)
|
return old_is_protected(pos, name, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
local tname = ctf.player(name).team
|
local tname = ctf.player(name).team
|
||||||
|
@ -225,7 +225,7 @@ if minetest.get_modpath("ctf") then
|
||||||
minetest.chat_send_player(name, "Can't dig beyond the barrier!")
|
minetest.chat_send_player(name, "Can't dig beyond the barrier!")
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
return old_is_protected(pos, name)
|
return old_is_protected(pos, name, ...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue