forked from MineClone5/MineClone5
Set swiming detection to "node_feet"
This commit is contained in:
parent
0e026c187e
commit
c238fd9ba7
|
@ -157,7 +157,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
-- ask if player is in a place which he should crawl
|
-- ask if player is in a place which he should crawl
|
||||||
node_in_feet = minetest.registered_nodes[mcl_playerinfo[name].node_feet]
|
node_in_feet = minetest.registered_nodes[mcl_playerinfo[name].node_feet]
|
||||||
-- ask if player is swiming
|
-- ask if player is swiming
|
||||||
standing_on_water = minetest.get_item_group(mcl_playerinfo[name].node_stand, "water") ~= 0
|
standing_on_water = minetest.get_item_group(mcl_playerinfo[name].node_feet, "water") ~= 0
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,6 @@ minetest.register_globalstep(function(dtime)
|
||||||
-- controls head bone
|
-- controls head bone
|
||||||
local pitch = degrees(player:get_look_vertical()) * -1
|
local pitch = degrees(player:get_look_vertical()) * -1
|
||||||
|
|
||||||
local node_in_feet = minetest.registered_nodes[mcl_playerinfo[name].node_feet]
|
|
||||||
|
|
||||||
-- controls right and left arms pitch when shooting a bow or punching
|
-- controls right and left arms pitch when shooting a bow or punching
|
||||||
if string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB and not controls.LMB and not controls.up and not controls.down and not controls.left and not controls.right then
|
if string.find(player:get_wielded_item():get_name(), "mcl_bows:bow") and controls.RMB and not controls.LMB and not controls.up and not controls.down and not controls.left and not controls.right then
|
||||||
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch+90,-30,pitch * -1 * .35))
|
player:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(pitch+90,-30,pitch * -1 * .35))
|
||||||
|
@ -46,7 +44,7 @@ minetest.register_globalstep(function(dtime)
|
||||||
-- sets eye height, and nametag color accordingly
|
-- sets eye height, and nametag color accordingly
|
||||||
player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,1.8,0.35}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 0, g = 225 }})
|
player:set_properties({collisionbox = {-0.35,0,-0.35,0.35,1.8,0.35}, eye_height = 1.35, nametag_color = { r = 225, b = 225, a = 0, g = 225 }})
|
||||||
|
|
||||||
elseif minetest.get_item_group(mcl_playerinfo[name].node_stand, "water") ~= 0 and player:get_attach() == nil then
|
elseif minetest.get_item_group(mcl_playerinfo[name].node_feet, "water") ~= 0 and player:get_attach() == nil then
|
||||||
-- controls head pitch when swiming
|
-- controls head pitch when swiming
|
||||||
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+90,0,0))
|
player:set_bone_position("Head", vector.new(0,6.3,0), vector.new(pitch+90,0,0))
|
||||||
-- sets eye height, and nametag color accordingly
|
-- sets eye height, and nametag color accordingly
|
||||||
|
|
Loading…
Reference in New Issue