Change if to hard assertion

master
Lars Mueller 2022-05-12 12:34:32 +02:00
parent 2e2df7cc3f
commit 9e67cb36a8
1 changed files with 1 additions and 4 deletions

View File

@ -193,10 +193,7 @@ function handle_player_animations(dtime, player)
local euler_rotation = quaternion.to_euler_rotation(rotation)
bones[bone] = {position = position, rotation = rotation, euler_rotation = euler_rotation}
end
if not (bones.Body and bones.Head and bones.Arm_Right) then
-- Model is missing some bones, don't animate serverside
return
end
assert(bones.Body and bones.Head and bones.Arm_Right, "Player model is missing Body, Head or Arm_Right bones")
local Body, Head, Arm_Right = bones.Body.euler_rotation, bones.Head.euler_rotation, bones.Arm_Right.euler_rotation
local look_vertical = -math.deg(player:get_look_vertical())
Head.x = look_vertical