From e542c3a0c11680c5e92c57583ccd40bef7357a17 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Thu, 7 Mar 2019 19:26:22 -0600 Subject: [PATCH] Move: code to right file --- mods/ctf_pvp_engine/ctf_flag/flags.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mods/ctf_pvp_engine/ctf_flag/flags.lua b/mods/ctf_pvp_engine/ctf_flag/flags.lua index 5583ca8..006cb90 100644 --- a/mods/ctf_pvp_engine/ctf_flag/flags.lua +++ b/mods/ctf_pvp_engine/ctf_flag/flags.lua @@ -129,6 +129,12 @@ function register_flag(def) .. " Leave at least " .. r .. " blocks around the flag.") return itemstack end + + local team, index = ctf.get_territory_owner(pos) + if team ~= nil then + minetest.chat_send_player(name, "You cannot place a flag in a protected area!") + return itemstack + end local tplayer = ctf.player_or_nil(name) if tplayer and ctf.team(tplayer.team) then @@ -137,7 +143,7 @@ function register_flag(def) return itemstack end - local tname = tplayer.team + local tname = tplayer.team local team = ctf.team(tplayer.team) if elementsInTable(team.players) <= elementsInTable(team.flags) then