removed unnecessary node_above_head variable

This commit is contained in:
Sumyjkl 2022-07-17 21:50:22 +10:00
parent e4c7d575fc
commit 2e06e22d70
2 changed files with 6 additions and 15 deletions

View File

@ -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)

View File

@ -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