-- Fixed a lot of issues with cargo when the cargo representative is destroyed.

This commit is contained in:
FlightControl_Master
2018-03-27 20:59:37 +02:00
parent b1a1c6c552
commit 7a579a0ab5
2 changed files with 42 additions and 37 deletions

View File

@@ -126,7 +126,7 @@ function AI_CARGO_TROOPS:onafterMonitor( CargoCarrier, From, Event, To )
local Coordinate = CargoCarrier:GetCoordinate()
self.Zone:Scan( { Object.Category.UNIT } )
if self.Zone:IsAllInZoneOfCoalition( self.Coalition ) then
if self:Is( "Unloaded" ) or self:Is( "Guarding" ) then
if self:Is( "Unloaded" ) or self:Is( "Guarding" ) or self:Is( "Following" ) then
-- There are no enemies within combat range. Load the CargoCarrier.
self:__Load( 1 )
end
@@ -158,7 +158,7 @@ function AI_CARGO_TROOPS:onafterLoad( CargoCarrier, From, Event, To )
if CargoCarrier and CargoCarrier:IsAlive() then
CargoCarrier:RouteStop()
self:Board()
self.CargoGroup:Board( CargoCarrier, 5 )
self.CargoGroup:Board( CargoCarrier, 25 )
end
end