Skip to content

Commit

Permalink
06.01.00052:next fix for covers
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasGaertner committed Feb 9, 2019
1 parent 0011df0 commit 2aa2d79
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 30 deletions.
2 changes: 1 addition & 1 deletion GrainTransportAIDriver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion drive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion modDesc.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="40">
<version>6.01.00051</version>
<version>6.01.00052</version>
<author><![CDATA[Courseplay.devTeam]]></author>
<title>
<br>CoursePlay SIX</br>
Expand Down
5 changes: 0 additions & 5 deletions start_stop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
45 changes: 23 additions & 22 deletions toolManager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2aa2d79

Please sign in to comment.