fix is_pressing_jump being global

This commit is contained in:
Sumyjkl 2022-08-07 00:38:20 +10:00
parent 1263c43b5d
commit 509fadfebb

View File

@ -1,8 +1,8 @@
mcl_playerplus = { mcl_playerplus = {
elytra = {}, elytra = {},
is_pressing_jump = {},
} }
local is_pressing_jump = false
local get_connected_players = minetest.get_connected_players local get_connected_players = minetest.get_connected_players
local dir_to_yaw = minetest.dir_to_yaw local dir_to_yaw = minetest.dir_to_yaw
local get_item_group = minetest.get_item_group local get_item_group = minetest.get_item_group
@ -279,8 +279,8 @@ minetest.register_globalstep(function(dtime)
elytra.speed = 2 elytra.speed = 2
end end
local is_just_jumped = control.jump and not is_pressing_jump and not elytra.active local is_just_jumped = control.jump and not mcl_playerplus.is_pressing_jump[name] and not elytra.active
is_pressing_jump = control.jump mcl_playerplus.is_pressing_jump[name] = control.jump
if is_just_jumped and not elytra.active then if is_just_jumped and not elytra.active then
elytra.speed = clamp(get_overall_velocity(player:get_velocity()) - 1, 0, 2) elytra.speed = clamp(get_overall_velocity(player:get_velocity()) - 1, 0, 2)
end end