From f040ee5bc7ca33a963fd58687cddadafa1e95eb6 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sat, 15 Jun 2019 20:37:16 +0100 Subject: [PATCH] fix nil value when mob not available --- mount.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mount.lua b/mount.lua index d1f5841..a82dfee 100644 --- a/mount.lua +++ b/mount.lua @@ -212,7 +212,8 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) end -- fix mob rotation - entity.object:set_yaw(entity.driver:get_look_horizontal() - entity.rotate) + local horz = entity.driver:get_look_horizontal() or 0 + entity.object:set_yaw(horz - entity.rotate) if can_fly then @@ -259,7 +260,7 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) return end - + -- set moving animation if moving_anim then mobs:set_animation(entity, moving_anim)