diff options
author | Piezo_ <orderofthefourthwall@gmail.com> | 2018-12-09 16:19:10 -0800 |
---|---|---|
committer | Piezo_ <orderofthefourthwall@gmail.com> | 2018-12-09 16:19:10 -0800 |
commit | 61b870b9af4daa1c900d7bb936de5121ab8d005a (patch) | |
tree | 941d1b317627a06bf0693672b749bf76dce12e6d | |
parent | 1555555ac4e7ddfa0099d623025034646e14bd45 (diff) | |
download | hangglider-61b870b9af4daa1c900d7bb936de5121ab8d005a.tar.gz hangglider-61b870b9af4daa1c900d7bb936de5121ab8d005a.tar.bz2 hangglider-61b870b9af4daa1c900d7bb936de5121ab8d005a.zip |
Removed airstopper until minetest devs are smart enough to implement serverside players
-rw-r--r-- | init.lua | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -52,7 +52,7 @@ hangglider.id = {} -- hud id for displaying overlay with struts end if debug then hangglider.debug = {} end -- hud id for debug data --hangglider.airbreak = {} -- true if falling fast when equip - +--[[ minetest.register_entity("hangglider:airstopper", { --A one-instant entity that catches the player and stops them. is_visible = false, physical = false, @@ -85,7 +85,7 @@ minetest.register_entity("hangglider:airstopper", { --A one-instant entity that self.object:remove() end end -}) +})]] if minetestd and minetestd.services.gravityctl.enabled then minetestd.gravityctl.register_gravity_effect("hangglider", @@ -123,8 +123,10 @@ minetest.register_entity("hangglider:glider", { if not (mrn_name.walkable or (mrn_name.drowning and mrn_name.drowning == 1)) then canExist = true step_v = player:get_player_velocity().y - if step_v < 0 then + if step_v < 0 and step_v > -3 then player:set_physics_override({speed=math.abs(step_v/2) + 0.75}) + elseif step_v <= -3 then --Cap our fall speed. + player:set_physics_override({speed=2.25}) else player:set_physics_override({speed=1}) end @@ -221,7 +223,7 @@ minetest.register_tool("hangglider:hangglider", { if HUD_Overlay then player:hud_change(hangglider.id[pname], "text", "glider_struts.png") end local airbreak = false local vel = player:get_player_velocity().y - if vel < -1.5 then -- engage mid-air, falling fast, so stop but ramp velocity more quickly + --[[if vel < -1.5 then -- engage mid-air, falling fast, so stop but ramp velocity more quickly --hangglider.airbreak[pname] = true airbreak = true local stopper = minetest.add_entity(pos, "hangglider:airstopper") @@ -230,7 +232,7 @@ minetest.register_tool("hangglider:hangglider", { stopper:get_luaentity().attach = player player:set_attach( stopper, "", {x=0,y=0,z=0}, {x=0,y=0,z=0}) end, stopper, player) - end + end]] if not airbreak then if moveModelUp then minetest.add_entity(pos, "hangglider:glider"):set_attach(player, "", {x=0,y=10,z=0}, {x=0,y=0,z=0}) |