From 37828b27a090cb3944a66e195b7113d39328f3f6 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sun, 1 Aug 2021 21:01:08 +0200 Subject: [PATCH] Do not rotate a boat while it is attached Rotating a boat while it is attached to another object does not work as expected: While the boat does not visually rotate, the head of the driver rotates as if the boat did actually rotate. That looks wrong, therefore no rotation must happen if the boat is attached to an object, e.g. a minecart. --- mods/ENTITIES/mcl_boats/init.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mods/ENTITIES/mcl_boats/init.lua b/mods/ENTITIES/mcl_boats/init.lua index a07d96fd..8fcddcb1 100644 --- a/mods/ENTITIES/mcl_boats/init.lua +++ b/mods/ENTITIES/mcl_boats/init.lua @@ -305,13 +305,22 @@ function boat.on_step(self, dtime, moveresult) self._animation = 0 end end - if ctrl and ctrl.left then + -- Rotating a boat while it is attached to another + -- object does not work as expected: While the boat + -- does not visually rotate, the head of the driver + -- rotates as if the boat did actually rotate. That + -- looks wrong, therefore no rotation must happen if + -- the boat is attached to an object, e.g. a minecart. + -- + -- TODO: Actually rotate boat once someone figures out + -- how to rotate an object attached to another object. + if ctrl and ctrl.left and not self.object:get_attach() then if self._v < 0 then self.object:set_yaw(yaw - (1 + dtime) * 0.03 * v_factor) else self.object:set_yaw(yaw + (1 + dtime) * 0.03 * v_factor) end - elseif ctrl and ctrl.right then + elseif ctrl and ctrl.right and not self.object:get_attach() then if self._v < 0 then self.object:set_yaw(yaw + (1 + dtime) * 0.03 * v_factor) else