Skip to content

Commit 3088c20

Browse files
committed
Condense motor restart logic
1 parent ff74149 commit 3088c20

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

scripts/ai/controllers/MotorController.lua

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,8 @@ function MotorController:update()
2525
if not self.isValid then
2626
return
2727
end
28-
if not self.settings.fuelSave:getValue() then
29-
if not self:getIsStarted() then
30-
self:startMotor()
31-
self.vehicle:raiseAIEvent('onAIFieldWorkerContinue', 'onAIImplementContinue')
32-
end
33-
self.timerSet = false
34-
end
3528
if self:isFuelSaveDisabled() or self.driveStrategy:getMaxSpeed() >
36-
self.speedThreshold then
29+
self.speedThreshold or not self.settings.fuelSave:getValue() then
3730
if not self:getIsStarted() then
3831
self:startMotor()
3932
self.vehicle:raiseAIEvent("onAIFieldWorkerContinue", "onAIImplementContinue")
@@ -84,7 +77,7 @@ function MotorController:getDriveData()
8477
end
8578
if g_Courseplay.globalSettings.waitForRefueling:getValue() and
8679
self:isFuelLow(self.fuelThresholdSetting:getValue()) then
87-
80+
8881
maxSpeed = 0
8982
end
9083

0 commit comments

Comments
 (0)