diff options
author | Piezo_ <orderofthefourthwall@gmail.com> | 2018-12-29 13:13:18 -0800 |
---|---|---|
committer | Piezo_ <orderofthefourthwall@gmail.com> | 2018-12-29 13:13:18 -0800 |
commit | 1ffed41784dd0534436e239fe54ab07877894097 (patch) | |
tree | f0ba8dff9064dbc7778d3ecd44e36ea75675de76 | |
parent | 954ce034356dbf00088141c8d7462c24f15d8f47 (diff) | |
download | hangglider-1ffed41784dd0534436e239fe54ab07877894097.tar.gz hangglider-1ffed41784dd0534436e239fe54ab07877894097.tar.bz2 hangglider-1ffed41784dd0534436e239fe54ab07877894097.zip |
Added wardzones support
-rw-r--r-- | init.lua | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |