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