-- Improved gravity adjustment function.
-- Changed airbreaking process
-- Removed airbreak penalty, as any 'advantage' seems minimal after new adjustments
-
+ -- Removed airbreak until minetest devs are smart enough to implement better serverside players.
+ -- Simplified liquid check.
+-- Modifications by gpcf
+-- 2018-12-09
+-- get shot down while flying over protected areas marked as no-fly-zones (flak, from German Flugabwehrkanone)
+-- set these areas with the /area_flak command
+
+
+
local HUD_Overlay = true --show glider struts as overlay on HUD
local debug = false --show debug info in top-center of hud
local moveModelUp = false
self.object:remove()
end
end
- })
+ })]]
+if areas then
+ hangglider.flak = true
+ -- chat command definition essentially copied from areas mod.
+ minetest.register_chatcommand("area_flak",{
+ params = "<ID>",
+ description = "Toggle airspace restrictions for area <ID>",
+ func = function(name, param)
+ local id = tonumber(param)
+ if not id then
+ return false, "Invalid usage, see /help area_flak."
+ end
+
+ if not areas:isAreaOwner(id, name) then
+ return false, "Area "..id.." does not exist"
+ .." or is not owned by you."
+ end
+ local open = not areas.areas[id].flak
+ -- Save false as nil to avoid inflating the DB.
+ areas.areas[id].flak = open or nil
+ areas:save()
+ return true, ("Area's airspace %s."):format(open and "closed" or "opened")
+ end
+ })
+end
+
if minetestd and minetestd.services.gravityctl.enabled then
minetestd.gravityctl.register_gravity_effect("hangglider",
function(player)