diff --git a/CombineAIDriver.lua b/CombineAIDriver.lua index b2700dc80..aa97d4ffc 100644 --- a/CombineAIDriver.lua +++ b/CombineAIDriver.lua @@ -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 @@ -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 diff --git a/CombineUnloadManager.lua b/CombineUnloadManager.lua index c21489b20..83741bcfc 100644 --- a/CombineUnloadManager.lua +++ b/CombineUnloadManager.lua @@ -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; diff --git a/UnloadableFieldworkAIDriver.lua b/UnloadableFieldworkAIDriver.lua index 43cae78b6..e636c2245 100644 --- a/UnloadableFieldworkAIDriver.lua +++ b/UnloadableFieldworkAIDriver.lua @@ -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