Skip to content

Commit 4a9f7db

Browse files
authored
Merge pull request #1197 from cjkreklow/patch-fuelsave
Fix fuel save bypass in MotorController
2 parents 85dd7d6 + 3088c20 commit 4a9f7db

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

scripts/ai/controllers/MotorController.lua

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +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-
return
35-
end
3628
if self:isFuelSaveDisabled() or self.driveStrategy:getMaxSpeed() >
37-
self.speedThreshold then
29+
self.speedThreshold or not self.settings.fuelSave:getValue() then
3830
if not self:getIsStarted() then
3931
self:startMotor()
4032
self.vehicle:raiseAIEvent("onAIFieldWorkerContinue", "onAIImplementContinue")
@@ -85,7 +77,7 @@ function MotorController:getDriveData()
8577
end
8678
if g_Courseplay.globalSettings.waitForRefueling:getValue() and
8779
self:isFuelLow(self.fuelThresholdSetting:getValue()) then
88-
80+
8981
maxSpeed = 0
9082
end
9183

@@ -132,4 +124,4 @@ end
132124

133125
function MotorController:getIsStarted()
134126
return self.vehicle:getMotorState() ~= MotorState.OFF
135-
end
127+
end

0 commit comments

Comments
 (0)