From 819a8a81efcfddda1c7a76a525f2038fc147021b Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 5 Oct 2025 21:42:12 +0200 Subject: [PATCH] Only rotate after each slice in VolumeExcavationController if our width is > 1 --- controller/volume_excavation_controller.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/controller/volume_excavation_controller.lua b/controller/volume_excavation_controller.lua index 2570f4b..d0fc449 100644 --- a/controller/volume_excavation_controller.lua +++ b/controller/volume_excavation_controller.lua @@ -50,7 +50,7 @@ function VolumeExcavationController:Excavate() self.controller:MoveRelative(self.config.mine_right) self.controller:TurnToDirection(Direction.WEST) - -- Zig zag mine back to front + -- Zig zag mine the full width from back to front -- The direction is important so we can travel to start without colliding with unminded walls local turn_dir = 1 for i = 1,self.config.mine_forward do @@ -62,9 +62,12 @@ function VolumeExcavationController:Excavate() break end - self.controller:TurnRelative(turn_dir) - self.controller:MoveRelative(1) - self.controller:TurnRelative(turn_dir) + -- Skip the turning if we're mining in a straight line + if self.config.mine_left + self.config.mine_right > 0 then + self.controller:TurnRelative(turn_dir) + self.controller:MoveRelative(1) + self.controller:TurnRelative(turn_dir) + end turn_dir = -1 * turn_dir end