From 1ffed41784dd0534436e239fe54ab07877894097 Mon Sep 17 00:00:00 2001 From: Piezo_ Date: Sat, 29 Dec 2018 13:13:18 -0800 Subject: Added wardzones support --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 8284a9b..6fc4024 100644 --- a/init.lua +++ b/init.lua @@ -137,7 +137,13 @@ end hangglider.can_fly = function (pname, pos) -- 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 for id, area in pairs(areas:getAreasAtPos(pos)) do if area.flak then -- cgit v1.2.3