Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Straw Harvest Premos Support (#6031)
Browse files Browse the repository at this point in the history
* Straw Harvest Premos Support
  • Loading branch information
GeorgeEarslight authored Sep 6, 2020
1 parent edc75bb commit e28884e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
10 changes: 9 additions & 1 deletion CombineAIDriver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,15 @@ function CombineAIDriver:init(vehicle)
self.combine = self.vehicle.spec_combine
else
local combineImplement = AIDriverUtil.getAIImplementWithSpecialization(self.vehicle, Combine)
local peletizerImplement = AIDriverUtil.getAIImplementWithSpecialization(self.vehicle, FS19_addon_strawHarvest.StrawHarvestPelletizer)
if combineImplement then
self.combine = combineImplement.spec_combine
elseif peletizerImplement then
self.combine = peletizerImplement
self.combine.fillUnitIndex = 1
self.combine.spec_aiImplement.rightMarker = self.combine.rootNode
self.combine.spec_aiImplement.leftMarker = self.combine.rootNode
self.combine.spec_aiImplement.backMarker = self.combine.rootNode
else
self:error('Vehicle is not a combine and could not find implement with spec_combine')
end
Expand Down Expand Up @@ -1004,7 +1011,8 @@ function CombineAIDriver:handlePipe()
end

function CombineAIDriver:handleCombinePipe()
if self:isFillableTrailerUnderPipe() or self:isAutoDriveWaitingForPipe() or (self:isWaitingForUnload() and self.vehicle.cp.settings.pipeAlwaysUnfold:is(true)) then

if self:isFillableTrailerUnderPipe() or self:isAutoDriveWaitingForPipe() or (self:isWaitingForUnload() and self.vehicle.cp.settings.pipeAlwaysUnfold:is(true)) then
self:openPipe()
else
--wait until the objects under the pipe are gone
Expand Down
2 changes: 1 addition & 1 deletion CombineUnloadManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function CombineUnloadManager:addCombineToList(vehicle, driver)
driver = driver,
combineObject = combineObject,
isChopper = courseplay:isChopper(combineObject),
isCombine = courseplay:isCombine(combineObject) and not courseplay:isChopper(combineObject),
isCombine = (courseplay:isCombine(combineObject) or combineObject.isPremos) and not courseplay:isChopper(combineObject),
isOnFieldNumber = 0;
fillLevel = 0;
fillLevelPct = 0;
Expand Down
2 changes: 2 additions & 0 deletions UnloadableFieldworkAIDriver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ function UnloadableFieldworkAIDriver.create(vehicle)
elseif SpecializationUtil.hasSpecialization(Plow, vehicle.specializations) or
AIDriverUtil.hasAIImplementWithSpecialization(vehicle, Plow) then
return PlowAIDriver(vehicle)
elseif AIDriverUtil.hasAIImplementWithSpecialization(vehicle, FS19_addon_strawHarvest.StrawHarvestPelletizer) then
return CombineAIDriver(vehicle)
else
return UnloadableFieldworkAIDriver(vehicle)
end
Expand Down

0 comments on commit e28884e

Please sign in to comment.