mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-01-07 07:39:32 +01:00
Fix TNT Minecart Crash (#4799)
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4799 Reviewed-by: Mikita Wiśniewski <rudzik8@protonmail.com> Co-authored-by: teknomunk <teknomunk@protonmail.com> Co-committed-by: teknomunk <teknomunk@protonmail.com>
This commit is contained in:
parent
eb06f48875
commit
5ee94855b0
1 changed files with 1 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue