forked from Mineclonia/Mineclonia
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.
This commit is contained in:
parent
93b19d1588
commit
37828b27a0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue