diff --git a/mods/capturetheflag/ctf/core.lua b/mods/capturetheflag/ctf/core.lua index b7cfac1..1f1847f 100644 --- a/mods/capturetheflag/ctf/core.lua +++ b/mods/capturetheflag/ctf/core.lua @@ -162,8 +162,7 @@ function ctf.save() end end -ctf.area = {} -function ctf.area.get_territory_owner(pos) +function ctf.get_territory_owner(pos) local largest = nil local largest_weight = 0 for i = 1, #ctf.registered_on_territory_query do diff --git a/mods/capturetheflag/ctf/teams.lua b/mods/capturetheflag/ctf/teams.lua index 14747ca..790b712 100644 --- a/mods/capturetheflag/ctf/teams.lua +++ b/mods/capturetheflag/ctf/teams.lua @@ -271,7 +271,7 @@ minetest.register_on_newplayer(function(player) end) -- updates the spawn position for a team -function ctf.area.get_spawn(team) +function ctf.get_spawn(team) ctf_flag.asset_flags(team) if not ctf.team(team) then @@ -304,7 +304,7 @@ minetest.register_on_respawnplayer(function(player) if player and ctf.player(player:get_player_name()) then local team = ctf.player(player:get_player_name()).team if ctf.team(team) then - local spawn = ctf.area.get_spawn(team) + local spawn = ctf.get_spawn(team) player:moveto(spawn, false) return true end diff --git a/mods/capturetheflag/ctf_flag/flag_func.lua b/mods/capturetheflag/ctf_flag/flag_func.lua index 863c444..6343a33 100644 --- a/mods/capturetheflag/ctf_flag/flag_func.lua +++ b/mods/capturetheflag/ctf_flag/flag_func.lua @@ -193,7 +193,7 @@ ctf_flag = { ctf.team(team).spawn = pos end else - ctf.area.get_spawn(team) + ctf.get_spawn(team) end ctf.save() diff --git a/mods/capturetheflag/ctf_protect/init.lua b/mods/capturetheflag/ctf_protect/init.lua index 40624dc..746044b 100644 --- a/mods/capturetheflag/ctf_protect/init.lua +++ b/mods/capturetheflag/ctf_protect/init.lua @@ -2,7 +2,7 @@ local old_is_protected = minetest.is_protected function minetest.is_protected(pos, name) - local team = ctf.area.get_territory_owner(pos) + local team = ctf.get_territory_owner(pos) if not team or not ctf.team(team) then return old_is_protected(pos, name) diff --git a/mods/capturetheflag/ctf_turret/init.lua b/mods/capturetheflag/ctf_turret/init.lua index 099e53f..9368858 100644 --- a/mods/capturetheflag/ctf_turret/init.lua +++ b/mods/capturetheflag/ctf_turret/init.lua @@ -60,7 +60,7 @@ if ctf.setting("turrets") then return end - local app = ctf.area.get_territory_owner(pos) + local app = ctf.get_territory_owner(pos) if app and app~=team then team = app meta:set_string("team",team)