don't shoot down area owners

This commit is contained in:
OgelGames 2020-05-31 20:00:06 +10:00
parent c01518913b
commit a814fbe160

View File

@ -153,11 +153,17 @@ hangglider.can_fly = function (pname, pos)
wardzones.checkPlayerZoneAccess(pname, zone) or not zone["data"]["no_fly"]) wardzones.checkPlayerZoneAccess(pname, zone) or not zone["data"]["no_fly"])
end end
end end
if areas and hangglider.flak then if areas and hangglider.flak then
local flak = false
local owners = {}
for _, area in pairs(areas:getAreasAtPos(pos)) do for _, area in pairs(areas:getAreasAtPos(pos)) do
if area.flak then if area.flak then
return false flak = true
end end
owners[area.owner] = true
end
if flak and not owners[pname] then
return false
end end
end end
return true return true