Fix attempt to perform arithmetic on a nil value in mount.lua:232

This commit is contained in:
kay27 2022-01-12 04:33:55 +04:00
parent 7d7da2ba8b
commit 79170e2386
1 changed files with 2 additions and 1 deletions

View File

@ -229,7 +229,8 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime)
-- mob rotation
local rotate = entity.rotate
if rotate then
local yaw = entity.driver:get_look_horizontal() - rotate
local driver_look_horizontal = entity.driver:get_look_horizontal() or 0
local yaw = driver_look_horizontal - rotate
entity.yaw = yaw
entity.object:set_yaw(yaw)
end