From cacc9d384fb1b29b2bf061ced01c8a0490b84df5 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Sun, 29 Dec 2024 09:17:35 -0600 Subject: [PATCH] Handle edge case in mcl_minecarts.reverse_cart_direction() that lead to strange punching and pushing behavior --- mods/ENTITIES/mcl_minecarts/functions.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ENTITIES/mcl_minecarts/functions.lua b/mods/ENTITIES/mcl_minecarts/functions.lua index d1099c6fd..026f1ffc9 100644 --- a/mods/ENTITIES/mcl_minecarts/functions.lua +++ b/mods/ENTITIES/mcl_minecarts/functions.lua @@ -504,6 +504,10 @@ function mod.get_cart_position(cart_staticdata) end function mod.reverse_cart_direction(staticdata) + if staticdata.distance == 0 then + staticdata.dir = -staticdata.dir + return + end -- Complete moving thru this block into the next, reverse direction, and put us back at the same position we were at local next_dir = -staticdata.dir