Fix attempt to perform arithmetic on a nil value in mobs.drive()

This commit is contained in:
kay27 2021-07-25 19:42:29 +04:00
parent bab31d6cd7
commit 5bfec00295
1 changed files with 6 additions and 2 deletions

View File

@ -227,8 +227,12 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
end end
-- mob rotation -- mob rotation
entity.object:set_yaw(entity.driver:get_look_horizontal() - entity.rotate) local rotate = entity.rotate
entity.yaw = entity.driver:get_look_horizontal() - entity.rotate if rotate then
local yaw = entity.driver:get_look_horizontal() - rotate
entity.yaw = yaw
entity.object:set_yaw(yaw)
end
--[[ --[[
if can_fly then if can_fly then