forked from mtcontrib/hangglider
Added wardzones support
This commit is contained in:
parent
954ce03435
commit
1ffed41784
8
init.lua
8
init.lua
@ -137,7 +137,13 @@ end
|
|||||||
|
|
||||||
hangglider.can_fly = function (pname, pos)
|
hangglider.can_fly = function (pname, pos)
|
||||||
-- Checks if the player will get shot down at the position
|
-- Checks if the player will get shot down at the position
|
||||||
if minetest.is_protected(vector.round(pos), pname) then
|
if wardzones then
|
||||||
|
local zone = wardzones.getZone(pos)
|
||||||
|
if zone then
|
||||||
|
return (minetest.check_player_privs(pname, {protection_bypass=true}) or wardzones.checkPlayerZoneAccess(pname, zone) or not zone["data"]["no_fly"])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if areas and minetest.is_protected(vector.round(pos), pname) then
|
||||||
if hangglider.flak then
|
if hangglider.flak then
|
||||||
for id, area in pairs(areas:getAreasAtPos(pos)) do
|
for id, area in pairs(areas:getAreasAtPos(pos)) do
|
||||||
if area.flak then
|
if area.flak then
|
||||||
|
Loading…
Reference in New Issue
Block a user