Skip to content

Commit

Permalink
Merge pull request #3192 from Courseplay/Issue-3181
Browse files Browse the repository at this point in the history
Only check for valid filltype while driving to the unloading point
  • Loading branch information
Tensuko committed Apr 10, 2024
2 parents 5b20f7a + df3825b commit 1d42f61
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions scripts/ai/jobs/CpAIJobCombineUnloader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,17 @@ function CpAIJobCombineUnloader:canContinueWork()
if not canContinue then
return canContinue, errorMessage
end
local hasSupportedFillTypeLoaded = false
for _, dischargeNodeInfo in ipairs(self.dischargeNodeInfos) do
local fillType = dischargeNodeInfo.vehicle:getFillUnitFillType(dischargeNodeInfo.dischargeNode.fillUnitIndex)
if self.supportedFillTypes[fillType] then
hasSupportedFillTypeLoaded = true
if self.currentTaskIndex == self.driveToUnloadingTask.taskIndex then
local hasSupportedFillTypeLoaded = false
for _, dischargeNodeInfo in ipairs(self.dischargeNodeInfos) do
local fillType = dischargeNodeInfo.vehicle:getFillUnitFillType(dischargeNodeInfo.dischargeNode.fillUnitIndex)
if self.supportedFillTypes[fillType] then
hasSupportedFillTypeLoaded = true
end
end
if not hasSupportedFillTypeLoaded then
return false, AIMessageErrorNoValidFillTypeLoaded.new()
end
end
if not hasSupportedFillTypeLoaded then
return false, AIMessageErrorNoValidFillTypeLoaded.new()
end
end

Expand Down

0 comments on commit 1d42f61

Please sign in to comment.