mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Cargo Dispatcher APC - Multiple Cargo Groups and Weight in APC
This commit is contained in:
@@ -416,6 +416,7 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
|
||||
self:F( { Cargo = Cargo:GetName(), UnLoaded = Cargo:IsUnLoaded(), Deployed = Cargo:IsDeployed(), PickupCargo = self.PickupCargo[Carrier] ~= nil } )
|
||||
if Cargo:IsUnLoaded() == true and Cargo:IsDeployed() == false then
|
||||
local CargoCoordinate = Cargo:GetCoordinate()
|
||||
self:F({CargoCoordinate = CargoCoordinate })
|
||||
local CoordinateFree = true
|
||||
for CarrierPickup, Coordinate in pairs( self.PickupCargo ) do
|
||||
if CarrierPickup:IsAlive() == true then
|
||||
@@ -427,6 +428,7 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
|
||||
self.PickupCargo[CarrierPickup] = nil
|
||||
end
|
||||
end
|
||||
self:F({CoordinateFree = CoordinateFree})
|
||||
if CoordinateFree == true then
|
||||
self.PickupCargo[Carrier] = CargoCoordinate
|
||||
PickupCargo = Cargo
|
||||
@@ -435,6 +437,8 @@ function AI_CARGO_DISPATCHER:onafterMonitor()
|
||||
end
|
||||
end
|
||||
|
||||
self:F( { PickupCargo = PickupCargo} )
|
||||
|
||||
if PickupCargo then
|
||||
self.CarrierHome[Carrier] = nil
|
||||
local PickupCoordinate = PickupCargo:GetCoordinate():GetRandomCoordinateInRadius( self.PickupOuterRadius, self.PickupInnerRadius )
|
||||
@@ -567,6 +571,7 @@ function AI_CARGO_DISPATCHER:OnAfterLoaded( From, Event, To, Carrier, Cargo )
|
||||
end
|
||||
end
|
||||
|
||||
self:F({Carrier=Carrier})
|
||||
self.PickupCargo[Carrier] = nil
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user