forked from mtcontrib/hangglider
don't shoot down area owners
This commit is contained in:
parent
c01518913b
commit
a814fbe160
8
init.lua
8
init.lua
@ -154,10 +154,16 @@ hangglider.can_fly = function (pname, pos)
|
|||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user