From 5bfec00295ba986abc0cfe7fca63565b54acacb4 Mon Sep 17 00:00:00 2001 From: kay27 Date: Sun, 25 Jul 2021 19:42:29 +0400 Subject: [PATCH] Fix attempt to perform arithmetic on a nil value in mobs.drive() --- mods/ENTITIES/mcl_mobs/api/mount.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_mobs/api/mount.lua b/mods/ENTITIES/mcl_mobs/api/mount.lua index 0ed54a46e..11b2e5e89 100644 --- a/mods/ENTITIES/mcl_mobs/api/mount.lua +++ b/mods/ENTITIES/mcl_mobs/api/mount.lua @@ -227,8 +227,12 @@ function mobs.drive(entity, moving_anim, stand_anim, can_fly, dtime) end -- mob rotation - entity.object:set_yaw(entity.driver:get_look_horizontal() - entity.rotate) - entity.yaw = entity.driver:get_look_horizontal() - entity.rotate + local rotate = 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