Remove ctf.area namespace
This commit is contained in:
parent
f44e0903c4
commit
9db50cfd3d
@ -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
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user