From 5ee94855b0db9ccae8436d94c0fdb10946c1fc59 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Fri, 3 Jan 2025 11:53:31 +0100 Subject: [PATCH] Fix TNT Minecart Crash (#4799) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4799 Reviewed-by: Mikita Wiśniewski Co-authored-by: teknomunk Co-committed-by: teknomunk --- mods/ENTITIES/mcl_minecarts/functions.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mods/ENTITIES/mcl_minecarts/functions.lua b/mods/ENTITIES/mcl_minecarts/functions.lua index db981981f..0b04824bc 100644 --- a/mods/ENTITIES/mcl_minecarts/functions.lua +++ b/mods/ENTITIES/mcl_minecarts/functions.lua @@ -456,7 +456,6 @@ local _2_pi = math.pi * 2 local _half_pi = math.pi * 0.5 local _quart_pi = math.pi * 0.25 local pi = math.pi -local rot_debug = {} function mod.update_cart_orientation(self) local staticdata = self._staticdata local dir = staticdata.dir @@ -469,9 +468,8 @@ function mod.update_cart_orientation(self) -- Check if the rotation is a 180 flip and don't change if so local rot = self.object:get_rotation() - local old_rot = vector.new(rot) - rot.y = (rot.y - _half_pi + _2_pi) % _2_pi if not rot then return end + rot.y = (rot.y - _half_pi + _2_pi) % _2_pi local diff = math.abs((rot_y - ( rot.y + pi ) % _2_pi) ) if diff < 0.001 or diff > _2_pi - 0.001 then