]> git.lizzy.rs Git - hangglider.git/commitdiff
Merge branch 'master' of https://notabug.org/Piezo_/minetest-hangglider
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Mon, 10 Dec 2018 11:29:47 +0000 (12:29 +0100)
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>
Mon, 10 Dec 2018 11:29:47 +0000 (12:29 +0100)
1  2 
init.lua

diff --cc init.lua
index 83a91bca2facf1e614e10c3926be90ea481b9d30,aa92f179eff273611b276aaf9643976cdbd2f71c..30b3ec9a5bf76d59216721b72d7bbe20a965aa11
+++ b/init.lua
  -- 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
@@@ -92,33 -86,8 +93,33 @@@ minetest.register_entity("hangglider:ai
                        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)