Skip to content

Fix fuel save bypass in MotorController#1197

Open
cjkreklow wants to merge 2 commits intoCourseplay:mainfrom
cjkreklow:patch-fuelsave
Open

Fix fuel save bypass in MotorController#1197
cjkreklow wants to merge 2 commits intoCourseplay:mainfrom
cjkreklow:patch-fuelsave

Conversation

@cjkreklow
Copy link

MotorController:update() was returning prematurely when Fuel Save was disabled, bypassing all additional MotorController logic.

Proposed fix for #1195

MotorController:update() was returning prematurely when Fuel Save was disabled, bypassing all additional MotorController logic
@Tensuko Tensuko requested a review from pvaiko February 22, 2026 16:16
self.timerSet = false
return
end
if self:isFuelSaveDisabled() or self.driveStrategy:getMaxSpeed() >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be more comfortable with this if we changed this to an elseif to prevent the rest of motor starting logic to run.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this makes the first two blocks functionally identical, I pushed a slightly different change that just condenses the two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants