Cargo Troops

This commit is contained in:
FlightControl_Master
2018-03-26 17:53:23 +02:00
parent e7518d69e6
commit b6fc46fdd0
2 changed files with 90 additions and 21 deletions

View File

@@ -1312,6 +1312,7 @@ function CARGO_GROUP:onafterBoarding( From, Event, To, CargoCarrier, NearRadius,
if not Boarded then
self:__Boarding( 1, CargoCarrier, NearRadius, ... )
else
self:F("Group Cargo is loaded")
self:__Load( 1, CargoCarrier, ... )
end
else
@@ -1458,6 +1459,27 @@ end
end
end
--- Route Cargo to Coordinate and randomize locations.
-- @param #CARGO_GROUP self
-- @param Core.Point#COORDINATE Coordinate
function CARGO_GROUP:RouteTo( Coordinate )
self:F( )
--local NearRadius = NearRadius or 25
if From == "UnLoaded" then
-- For each Cargo object within the CARGO_GROUPED, route each object to the CargoLoadPointVec2
self.CargoSet:ForEach(
function( Cargo, Coordinate )
Cargo.CargoObject:RouteTo( Coordinate )
end, Coordinate
)
end
end
end -- CARGO_GROUP