From 5bd6f4901f1fd796bc8fdfb9d3fa067b9a3b30f0 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Thu, 6 Sep 2018 19:23:13 +0200 Subject: [PATCH] Fixed issues with pickup zones. --- Moose Development/Moose/AI/AI_Cargo_APC.lua | 8 ++++---- Moose Development/Moose/AI/AI_Cargo_Dispatcher.lua | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Moose Development/Moose/AI/AI_Cargo_APC.lua b/Moose Development/Moose/AI/AI_Cargo_APC.lua index 4df35bc4c..8b2bd9eee 100644 --- a/Moose Development/Moose/AI/AI_Cargo_APC.lua +++ b/Moose Development/Moose/AI/AI_Cargo_APC.lua @@ -319,12 +319,12 @@ end --- @param #AI_CARGO_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() } ) if APC:IsAlive() then - self:Load( PickupZone) + self:Load( PickupZone ) self.Relocating = false self.Transporting = true 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 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}) 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. else - AI_CARGO_APC._Pickup( APC, self, PickupZone ) + AI_CARGO_APC._Pickup( APC, self, Coordinate, Speed, PickupZone ) end self.Relocating = true diff --git a/Moose Development/Moose/AI/AI_Cargo_Dispatcher.lua b/Moose Development/Moose/AI/AI_Cargo_Dispatcher.lua index 6ae9d3de5..58ed1ce92 100644 --- a/Moose Development/Moose/AI/AI_Cargo_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_Cargo_Dispatcher.lua @@ -900,7 +900,7 @@ function AI_CARGO_DISPATCHER:onafterMonitor() if not self.PickupZoneSet or PickupZone then for CarrierPickup, Coordinate in pairs( self.PickupCargo ) do if CarrierPickup:IsAlive() == true then - if CargoCoordinate:Get2DDistance( Coordinate ) <= 25 then + if CargoCoordinate:Get2DDistance( Coordinate ) <= 100 then CoordinateFree = false break end