forked from mtcontrib/3d_armor
add feather falling (#73)
* add feather falling add feather falling * add feather falling to init.lua add feather falling routine to globalstep * add feather falling to readme add feather falling to readme
This commit is contained in:
@ -440,6 +440,20 @@ end, true)
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
timer = timer + dtime
|
||||
|
||||
if armor.config.feather_fall == true then
|
||||
for _,player in pairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
if armor.def[name].feather > 0 then
|
||||
local vel_y = player:get_velocity().y
|
||||
if vel_y < 0 and vel_y < 3 then
|
||||
vel_y = -(vel_y * 0.05)
|
||||
player:add_velocity({x = 0, y = vel_y, z = 0})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if timer <= armor.config.init_delay then
|
||||
return
|
||||
end
|
||||
|
Reference in New Issue
Block a user