Fixed issues with pickup zones.

This commit is contained in:
FlightControl
2018-09-06 19:23:13 +02:00
parent 5c29f48a88
commit 5bd6f4901f
2 changed files with 5 additions and 5 deletions

View File

@@ -319,12 +319,12 @@ end
--- @param #AI_CARGO_APC --- @param #AI_CARGO_APC
-- @param Wrapper.Group#GROUP APC -- @param Wrapper.Group#GROUP APC
function AI_CARGO_APC._Pickup( APC, self, PickupZone ) function AI_CARGO_APC._Pickup( APC, self, Coordinate, Speed, PickupZone )
APC:F( { "AI_CARGO_APC._Pickup:", APC:GetName() } ) APC:F( { "AI_CARGO_APC._Pickup:", APC:GetName() } )
if APC:IsAlive() then if APC:IsAlive() then
self:Load( PickupZone) self:Load( PickupZone )
self.Relocating = false self.Relocating = false
self.Transporting = true self.Transporting = true
end end
@@ -364,7 +364,7 @@ function AI_CARGO_APC:onafterPickup( APC, From, Event, To, Coordinate, Speed, Pi
local Waypoints = APC:TaskGroundOnRoad( Coordinate, _speed, "Line abreast", true ) local Waypoints = APC:TaskGroundOnRoad( Coordinate, _speed, "Line abreast", true )
local TaskFunction = APC:TaskFunction( "AI_CARGO_APC._Pickup", self, PickupZone ) local TaskFunction = APC:TaskFunction( "AI_CARGO_APC._Pickup", self, Coordinate, Speed, PickupZone )
self:F({Waypoints = Waypoints}) self:F({Waypoints = Waypoints})
local Waypoint = Waypoints[#Waypoints] local Waypoint = Waypoints[#Waypoints]
@@ -372,7 +372,7 @@ function AI_CARGO_APC:onafterPickup( APC, From, Event, To, Coordinate, Speed, Pi
APC:Route( Waypoints, 1 ) -- Move after a random seconds to the Route. See the Route method for details. APC:Route( Waypoints, 1 ) -- Move after a random seconds to the Route. See the Route method for details.
else else
AI_CARGO_APC._Pickup( APC, self, PickupZone ) AI_CARGO_APC._Pickup( APC, self, Coordinate, Speed, PickupZone )
end end
self.Relocating = true self.Relocating = true

View File

@@ -900,7 +900,7 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
if not self.PickupZoneSet or PickupZone then if not self.PickupZoneSet or PickupZone then
for CarrierPickup, Coordinate in pairs( self.PickupCargo ) do for CarrierPickup, Coordinate in pairs( self.PickupCargo ) do
if CarrierPickup:IsAlive() == true then if CarrierPickup:IsAlive() == true then
if CargoCoordinate:Get2DDistance( Coordinate ) <= 25 then if CargoCoordinate:Get2DDistance( Coordinate ) <= 100 then
CoordinateFree = false CoordinateFree = false
break break
end end