Skip to content

Commit

Permalink
Fuel info text adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
schwiti6190 committed Oct 13, 2024
1 parent d2ba487 commit 06e4cde
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/ai/controllers/MotorController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,17 @@ function MotorController:update()
end
end
end
if self:isFuelLow(self.fuelThresholdSetting:getValue()) then
local needsFuelLowInfo = false
if self.refuelData.timer:get() then
--- Only apply this if no refueling is active.
if self:isFuelLow(self.fuelThresholdSetting:getValue()) then
self.vehicle:stopCurrentAIJob(AIMessageErrorOutOfFuel.new())
elseif self:isFuelLow(self.fuelThresholdSetting:getValue() + 5) then
needsFuelLowInfo = true
end
end
if needsFuelLowInfo then
self:setInfoText(InfoTextManager.FUEL_IS_LOW)
self.vehicle:stopCurrentAIJob(AIMessageErrorOutOfFuel.new())
else
self:clearInfoText(InfoTextManager.FUEL_IS_LOW)
end
Expand Down

0 comments on commit 06e4cde

Please sign in to comment.