From 509fadfebb90c5f0b8571cc20d732f3a425c1f54 Mon Sep 17 00:00:00 2001 From: Sumyjkl Date: Sun, 7 Aug 2022 00:38:20 +1000 Subject: [PATCH] fix is_pressing_jump being global --- mods/PLAYER/mcl_playerplus/init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 1a6bafb5c..fb630c9e7 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -1,8 +1,8 @@ mcl_playerplus = { elytra = {}, + is_pressing_jump = {}, } -local is_pressing_jump = false local get_connected_players = minetest.get_connected_players local dir_to_yaw = minetest.dir_to_yaw local get_item_group = minetest.get_item_group @@ -279,8 +279,8 @@ minetest.register_globalstep(function(dtime) elytra.speed = 2 end - local is_just_jumped = control.jump and not is_pressing_jump and not elytra.active - is_pressing_jump = control.jump + local is_just_jumped = control.jump and not mcl_playerplus.is_pressing_jump[name] and not elytra.active + mcl_playerplus.is_pressing_jump[name] = control.jump if is_just_jumped and not elytra.active then elytra.speed = clamp(get_overall_velocity(player:get_velocity()) - 1, 0, 2) end