forked from mtcontrib/hangglider
Removed airstopper until minetest devs are smart enough to implement serverside players
This commit is contained in:
parent
1555555ac4
commit
61b870b9af
12
init.lua
12
init.lua
@ -52,7 +52,7 @@ hangglider.id = {} -- hud id for displaying overlay with struts
|
|||||||
end
|
end
|
||||||
if debug then hangglider.debug = {} end -- hud id for debug data
|
if debug then hangglider.debug = {} end -- hud id for debug data
|
||||||
--hangglider.airbreak = {} -- true if falling fast when equip
|
--hangglider.airbreak = {} -- true if falling fast when equip
|
||||||
|
--[[
|
||||||
minetest.register_entity("hangglider:airstopper", { --A one-instant entity that catches the player and stops them.
|
minetest.register_entity("hangglider:airstopper", { --A one-instant entity that catches the player and stops them.
|
||||||
is_visible = false,
|
is_visible = false,
|
||||||
physical = false,
|
physical = false,
|
||||||
@ -85,7 +85,7 @@ minetest.register_entity("hangglider:airstopper", { --A one-instant entity that
|
|||||||
self.object:remove()
|
self.object:remove()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})]]
|
||||||
|
|
||||||
if minetestd and minetestd.services.gravityctl.enabled then
|
if minetestd and minetestd.services.gravityctl.enabled then
|
||||||
minetestd.gravityctl.register_gravity_effect("hangglider",
|
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
|
if not (mrn_name.walkable or (mrn_name.drowning and mrn_name.drowning == 1)) then
|
||||||
canExist = true
|
canExist = true
|
||||||
step_v = player:get_player_velocity().y
|
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})
|
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
|
else
|
||||||
player:set_physics_override({speed=1})
|
player:set_physics_override({speed=1})
|
||||||
end
|
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
|
if HUD_Overlay then player:hud_change(hangglider.id[pname], "text", "glider_struts.png") end
|
||||||
local airbreak = false
|
local airbreak = false
|
||||||
local vel = player:get_player_velocity().y
|
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
|
--hangglider.airbreak[pname] = true
|
||||||
airbreak = true
|
airbreak = true
|
||||||
local stopper = minetest.add_entity(pos, "hangglider:airstopper")
|
local stopper = minetest.add_entity(pos, "hangglider:airstopper")
|
||||||
@ -230,7 +232,7 @@ minetest.register_tool("hangglider:hangglider", {
|
|||||||
stopper:get_luaentity().attach = player
|
stopper:get_luaentity().attach = player
|
||||||
player:set_attach( stopper, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
|
player:set_attach( stopper, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
|
||||||
end, stopper, player)
|
end, stopper, player)
|
||||||
end
|
end]]
|
||||||
if not airbreak then
|
if not airbreak then
|
||||||
if moveModelUp 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})
|
minetest.add_entity(pos, "hangglider:glider"):set_attach(player, "", {x=0,y=10,z=0}, {x=0,y=0,z=0})
|
||||||
|
Loading…
Reference in New Issue
Block a user