From 2e06e22d7082854d3c9e02f6c483cb2e80b9e8dd Mon Sep 17 00:00:00 2001 From: Sumyjkl Date: Sun, 17 Jul 2022 21:50:22 +1000 Subject: [PATCH] removed unnecessary node_above_head variable --- mods/PLAYER/mcl_playerinfo/init.lua | 10 ++-------- mods/PLAYER/mcl_playerplus/init.lua | 11 ++++------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/mods/PLAYER/mcl_playerinfo/init.lua b/mods/PLAYER/mcl_playerinfo/init.lua index e37d6750b9..9c5d1433f3 100644 --- a/mods/PLAYER/mcl_playerinfo/init.lua +++ b/mods/PLAYER/mcl_playerinfo/init.lua @@ -34,14 +34,10 @@ local function get_player_nodes(player_pos) work_pos.y = work_pos.y + 1.5 -- head level local node_head = node_ok(work_pos) - work_pos.y = work_pos.y + 2.2 -- above head level - local node_above_head = node_ok(work_pos) - work_pos.y = work_pos.y - 2.2 -- above head level - work_pos.y = work_pos.y - 1.2 -- feet level local node_feet = node_ok(work_pos) - return node_stand, node_stand_below, node_head, node_feet, node_above_head + return node_stand, node_stand_below, node_head, node_feet end minetest.register_globalstep(function(dtime) @@ -66,12 +62,11 @@ minetest.register_globalstep(function(dtime) local pos = player:get_pos() -- what is around me? - local node_stand, node_stand_below, node_head, node_feet, node_above_head = get_player_nodes(pos) + local node_stand, node_stand_below, node_head, node_feet = get_player_nodes(pos) mcl_playerinfo[name].node_stand = node_stand mcl_playerinfo[name].node_stand_below = node_stand_below mcl_playerinfo[name].node_head = node_head mcl_playerinfo[name].node_feet = node_feet - mcl_playerinfo[name].node_above_head = node_above_head end @@ -86,7 +81,6 @@ minetest.register_on_joinplayer(function(player) node_feet = "", node_stand = "", node_stand_below = "", - node_above_head = "", } end) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index bb6734a8d7..713a079da2 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -118,7 +118,7 @@ function limit_vel_yaw(player_vel_yaw, yaw) return player_vel_yaw end -local node_stand, node_stand_below, node_head, node_feet, node_above_head +local node_stand, node_stand_below, node_head, node_feet local is_swimming -- This following part is 2 wrapper functions for player:set_bones @@ -400,16 +400,14 @@ minetest.register_globalstep(function(dtime) node_stand = mcl_playerinfo[name].node_stand node_stand_below = mcl_playerinfo[name].node_stand_below node_head = mcl_playerinfo[name].node_head - node_above_head = mcl_playerinfo[name].node_above_head node_feet = mcl_playerinfo[name].node_feet - if not node_stand or not node_stand_below or not node_head or not node_feet or not node_above_head then + if not node_stand or not node_stand_below or not node_head or not node_feet then return end if (not minetest.registered_nodes[node_stand] or not minetest.registered_nodes[node_stand_below] or not minetest.registered_nodes[node_head] - or not minetest.registered_nodes[node_feet] - or not minetest.registered_nodes[node_above_head]) then + or not minetest.registered_nodes[node_feet]) then return end @@ -467,9 +465,8 @@ minetest.register_globalstep(function(dtime) local node_stand = mcl_playerinfo[name].node_stand local node_stand_below = mcl_playerinfo[name].node_stand_below local node_head = mcl_playerinfo[name].node_head - local node_above_head = mcl_playerinfo[name].node_above_head local node_feet = mcl_playerinfo[name].node_feet - if not node_stand or not node_stand_below or not node_head or not node_feet or not node_above_head then + if not node_stand or not node_stand_below or not node_head or not node_feet then return end