From 2aa2d7957da7870a1ed5f487ba04260ab799ddf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=A4rtner?= Date: Sat, 9 Feb 2019 10:54:29 +0100 Subject: [PATCH] 06.01.00052:next fix for covers #3104 --- GrainTransportAIDriver.lua | 2 +- drive.lua | 2 +- modDesc.xml | 2 +- start_stop.lua | 5 ----- toolManager.lua | 45 +++++++++++++++++++------------------- 5 files changed, 26 insertions(+), 30 deletions(-) diff --git a/GrainTransportAIDriver.lua b/GrainTransportAIDriver.lua index 38f325295..abc478e79 100644 --- a/GrainTransportAIDriver.lua +++ b/GrainTransportAIDriver.lua @@ -100,7 +100,7 @@ function GrainTransportAIDriver:onWaypointChange(newIx) courseplay:changeRunCounter(self.vehicle, false) end -- Close cover after leaving the silo, assuming the silo is at waypoint 1 - if newIx == 3 then + if not self:hasTipTrigger() and not self:isNearFillPoint() then courseplay:openCloseCover(self.vehicle, courseplay.SHOW_COVERS) end diff --git a/drive.lua b/drive.lua index 6b3f75f48..248464a5b 100644 --- a/drive.lua +++ b/drive.lua @@ -648,7 +648,7 @@ function courseplay:drive(self, dt) self.cp.inTraffic = false; - + -- HANDLE TIPPER COVER if self.cp.tipperHasCover and self.cp.automaticCoverHandling and (self.cp.mode == 1 or self.cp.mode == 2 or self.cp.mode == 4 or self.cp.mode == 5 or self.cp.mode == 6) then local showCover = false; diff --git a/modDesc.xml b/modDesc.xml index dd7afb778..bd5d1df46 100644 --- a/modDesc.xml +++ b/modDesc.xml @@ -1,6 +1,6 @@ - 6.01.00051 + 6.01.00052 <br>CoursePlay SIX</br> diff --git a/start_stop.lua b/start_stop.lua index a32951a8f..fa9fedd7c 100644 --- a/start_stop.lua +++ b/start_stop.lua @@ -801,11 +801,6 @@ function courseplay:stop(self) self:setTurnLightState(Lights.TURNLIGHT_OFF); end; - --open all covers --Tommi: Why ?? - --[[if self.cp.workToolAttached and self.cp.tipperHasCover and self.cp.mode == 1 or self.cp.mode == 2 or self.cp.mode == 5 or self.cp.mode == 6 then - courseplay:openCloseCover(self,not courseplay.SHOW_COVERS); - end;]] - -- resetting variables self.cp.ColliHeightSet = nil self.cp.tempCollis = {} diff --git a/toolManager.lua b/toolManager.lua index 635298565..dbd7bc82c 100644 --- a/toolManager.lua +++ b/toolManager.lua @@ -1268,29 +1268,30 @@ function courseplay:getTipTriggerFreeCapacity(trigger, fillType) end; function courseplay:resetTipTrigger(vehicle, changeToForward) - if vehicle.cp.tipperFillLevel == 0 then - vehicle.cp.isUnloaded = true; + if vehicle.cp.currentTipTrigger ~= nil then + if vehicle.cp.tipperFillLevel == 0 then + vehicle.cp.isUnloaded = true; + end + vehicle.cp.currentTipTrigger = nil; + vehicle.cp.handleAsOneSilo = nil; -- Used for BGA tipping + vehicle.cp.isReverseBGATipping = nil; -- Used for reverse BGA tipping + vehicle.cp.isBGATipping = false; + + for k, tipper in pairs(vehicle.cp.workTools) do + tipper.cp.BGASelectedSection = nil; -- Used for reverse BGA tipping + tipper.cp.isTipping = false; + tipper.cp.prevTrailerDistance = 100.00; + end; + vehicle.cp.inversedRearTipNode = nil; -- Used for reverse BGA tipping + if vehicle.cp.backupUnloadSpeed then + courseplay:changeReverseSpeed(vehicle, nil, vehicle.cp.backupUnloadSpeed, true); + vehicle.cp.backupUnloadSpeed = nil; + end; + if changeToForward and vehicle.Waypoints[vehicle.cp.waypointIndex].rev then + courseplay:setWaypointIndex(vehicle, courseplay:getNextFwdPoint(vehicle)); + vehicle.cp.ppc:initialize() + end; end - vehicle.cp.currentTipTrigger = nil; - vehicle.cp.handleAsOneSilo = nil; -- Used for BGA tipping - vehicle.cp.isReverseBGATipping = nil; -- Used for reverse BGA tipping - vehicle.cp.isBGATipping = false; - courseplay:openCloseCover(vehicle, courseplay.SHOW_COVERS) - - for k, tipper in pairs(vehicle.cp.workTools) do - tipper.cp.BGASelectedSection = nil; -- Used for reverse BGA tipping - tipper.cp.isTipping = false; - tipper.cp.prevTrailerDistance = 100.00; - end; - vehicle.cp.inversedRearTipNode = nil; -- Used for reverse BGA tipping - if vehicle.cp.backupUnloadSpeed then - courseplay:changeReverseSpeed(vehicle, nil, vehicle.cp.backupUnloadSpeed, true); - vehicle.cp.backupUnloadSpeed = nil; - end; - if changeToForward and vehicle.Waypoints[vehicle.cp.waypointIndex].rev then - courseplay:setWaypointIndex(vehicle, courseplay:getNextFwdPoint(vehicle)); - vehicle.cp.ppc:initialize() - end; end; -- this does not change lx/lz (direction), only allowedToDrive