Cargo Dispatcher APC - Multiple Cargo Groups and Weight in APC

This commit is contained in:
FlightControl
2018-08-17 07:59:53 +02:00
parent 9650129769
commit a02d3c1950
7 changed files with 97 additions and 31 deletions

View File

@@ -500,8 +500,6 @@ do -- CARGO_GROUP
-- @return Core.Point#COORDINATE The current Coordinate of the first Cargo of the CargoGroup.
-- @return #nil There is no valid Cargo in the CargoGroup.
function CARGO_GROUP:GetCoordinate()
self:F()
local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO
if Cargo then
@@ -635,12 +633,19 @@ do -- CARGO_GROUP
if Cargo then
local Distance = 0
local CargoCoordinate
if Cargo:IsLoaded() then
Distance = Coordinate:Get2DDistance( Cargo.CargoCarrier:GetCoordinate() )
CargoCoordinate = Cargo.CargoCarrier:GetCoordinate()
else
Distance = Coordinate:Get2DDistance( Cargo.CargoObject:GetCoordinate() )
CargoCoordinate = Cargo.CargoObject:GetCoordinate()
end
-- if CargoCoordinate then
Distance = Coordinate:Get2DDistance( CargoCoordinate )
-- else
-- return false
-- end
self:F( { Distance = Distance, LoadRadius = self.LoadRadius } )
if Distance <= self.LoadRadius then
return true