mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Cargo Transport
This commit is contained in:
@@ -338,6 +338,13 @@ function CARGO:IsUnLoaded()
|
|||||||
return self:Is( "UnLoaded" )
|
return self:Is( "UnLoaded" )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Check if cargo is boarding.
|
||||||
|
-- @param #CARGO self
|
||||||
|
-- @return #boolean true if boarding
|
||||||
|
function CARGO:IsBoarding()
|
||||||
|
return self:Is( "Boarding" )
|
||||||
|
end
|
||||||
|
|
||||||
--- Check if cargo is alive.
|
--- Check if cargo is alive.
|
||||||
-- @param #CARGO self
|
-- @param #CARGO self
|
||||||
-- @return #boolean true if unloaded
|
-- @return #boolean true if unloaded
|
||||||
@@ -944,7 +951,7 @@ do -- CARGO_UNIT
|
|||||||
else
|
else
|
||||||
self:__Boarding( -1, CargoCarrier, NearRadius, ... )
|
self:__Boarding( -1, CargoCarrier, NearRadius, ... )
|
||||||
self.RunCount = self.RunCount + 1
|
self.RunCount = self.RunCount + 1
|
||||||
if self.RunCount >= 20 then
|
if self.RunCount >= 60 then
|
||||||
self.RunCount = 0
|
self.RunCount = 0
|
||||||
local Speed = 90
|
local Speed = 90
|
||||||
local Angle = 180
|
local Angle = 180
|
||||||
|
|||||||
@@ -228,7 +228,6 @@ do -- TASK_CARGO
|
|||||||
|
|
||||||
if Cargo:IsAlive() then
|
if Cargo:IsAlive() then
|
||||||
|
|
||||||
self:E( "Cargo is alive" )
|
|
||||||
-- if Task:is( "RoutingToPickup" ) then
|
-- if Task:is( "RoutingToPickup" ) then
|
||||||
-- MENU_GROUP_COMMAND:New(
|
-- MENU_GROUP_COMMAND:New(
|
||||||
-- TaskUnit:GetGroup(),
|
-- TaskUnit:GetGroup(),
|
||||||
@@ -240,7 +239,7 @@ do -- TASK_CARGO
|
|||||||
-- ):SetTime(MenuTime)
|
-- ):SetTime(MenuTime)
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
self:E( { CargoUnloaded = Cargo:IsUnLoaded(), CargoLoaded = Cargo:IsLoaded(), CargoItemCount = CargoItemCount } )
|
self:F( { CargoUnloaded = Cargo:IsUnLoaded(), CargoLoaded = Cargo:IsLoaded(), CargoItemCount = CargoItemCount } )
|
||||||
|
|
||||||
if Cargo:IsUnLoaded() then
|
if Cargo:IsUnLoaded() then
|
||||||
if CargoItemCount <= Task.CargoLimit then
|
if CargoItemCount <= Task.CargoLimit then
|
||||||
@@ -251,14 +250,12 @@ do -- TASK_CARGO
|
|||||||
NotInDeployZones = false
|
NotInDeployZones = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
self:E( { NotInDeployZones = NotInDeployZones } )
|
|
||||||
if NotInDeployZones then
|
if NotInDeployZones then
|
||||||
if not TaskUnit:InAir() then
|
if not TaskUnit:InAir() then
|
||||||
MENU_GROUP_COMMAND:New( TaskUnit:GetGroup(), "Board cargo " .. Cargo.Name, TaskUnit.Menu, self.MenuBoardCargo, self, Cargo ):SetTime(MenuTime)
|
MENU_GROUP_COMMAND:New( TaskUnit:GetGroup(), "Board cargo " .. Cargo.Name, TaskUnit.Menu, self.MenuBoardCargo, self, Cargo ):SetTime(MenuTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
self:E( { "Route" } )
|
|
||||||
MENU_GROUP_COMMAND:New( TaskUnit:GetGroup(), "Route to Pickup cargo " .. Cargo.Name, TaskUnit.Menu, self.MenuRouteToPickup, self, Cargo ):SetTime(MenuTime)
|
MENU_GROUP_COMMAND:New( TaskUnit:GetGroup(), "Route to Pickup cargo " .. Cargo.Name, TaskUnit.Menu, self.MenuRouteToPickup, self, Cargo ):SetTime(MenuTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -280,7 +277,7 @@ do -- TASK_CARGO
|
|||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
--TaskUnit.Menu:Remove( MenuTime )
|
TaskUnit.Menu:Remove( MenuTime )
|
||||||
|
|
||||||
|
|
||||||
self:__SelectAction( -15 )
|
self:__SelectAction( -15 )
|
||||||
@@ -481,8 +478,10 @@ do -- TASK_CARGO
|
|||||||
if TaskUnit:InAir() then
|
if TaskUnit:InAir() then
|
||||||
--- ABORT the boarding. Split group if any and go back to select action.
|
--- ABORT the boarding. Split group if any and go back to select action.
|
||||||
else
|
else
|
||||||
self.Cargo:MessageToGroup( "Boarding ...", TaskUnit:GetGroup() )
|
self.Cargo:MessageToGroup( "Boarding ...", TaskUnit:GetGroup() )
|
||||||
self.Cargo:Board( TaskUnit, 20, self )
|
if not self.Cargo:IsBoarding() then
|
||||||
|
self.Cargo:Board( TaskUnit, 20, self )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
--self:__ArriveAtCargo( -0.1 )
|
--self:__ArriveAtCargo( -0.1 )
|
||||||
|
|||||||
Reference in New Issue
Block a user