Allow players to cross barrier if fly=true, interact=false

This commit is contained in:
ClobberXD 2018-11-29 21:49:07 +05:30 committed by rubenwardy
parent 7140e8430e
commit 678c86aef5

View file

@ -249,12 +249,15 @@ if minetest.get_modpath("ctf") then
local name = player:get_player_name() local name = player:get_player_name()
local tname = ctf.player(name).team local tname = ctf.player(name).team
local pos = player:get_pos() local pos = player:get_pos()
if tname and local privs = minetest.get_player_privs(name)
(tname == "blue" and pos.z >= 0) or (tname == "red" and pos.z <= 0) then if tname and not privs.fly and privs.interact then
if (tname == "blue" and pos.z >= 0) or
(tname == "red" and pos.z <= 0) then
minetest.chat_send_player(name, "Match hasn't started yet!") minetest.chat_send_player(name, "Match hasn't started yet!")
ctf.move_to_spawn(name) ctf.move_to_spawn(name)
end end
end end
end
if ctf_match.build_timer > 0.2 then if ctf_match.build_timer > 0.2 then
minetest.after(0.2, pos_check) minetest.after(0.2, pos_check)