Progress on AI_CARGO_TROOPS

This commit is contained in:
FlightControl_Master 2018-04-07 14:21:34 +02:00
parent a247f56c7e
commit 7735120f25
3 changed files with 46 additions and 24 deletions

View File

@ -232,6 +232,10 @@ do -- CARGO_UNIT
self.CargoInAir = self.CargoObject:InAir()
local Desc = self.CargoObject:GetDesc()
local MaxSpeed = Desc.speedMaxOffRoad
local TypeName = Desc.typeName
self:T( self.CargoInAir )
-- Only move the group to the carrier when the cargo is not in the air
@ -240,6 +244,10 @@ do -- CARGO_UNIT
if self:IsNear( CargoCarrier:GetPointVec2(), NearRadius ) then
self:Load( CargoCarrier, NearRadius, ... )
else
if MaxSpeed and MaxSpeed == 0 or TypeName and TypeName == "Stinger comm" then
self:Load( CargoCarrier, NearRadius, ... )
else
local Speed = 90
local Angle = 180
local Distance = 5
@ -264,6 +272,7 @@ do -- CARGO_UNIT
self.RunCount = 0
end
end
end
end

View File

@ -4131,6 +4131,19 @@ function SET_CARGO:New() --R2.1
return self
end
--- (R2.1) Add CARGO to SET_CARGO.
-- @param Core.Set#SET_CARGO self
-- @param Cargo.Cargo#CARGO Cargo A single cargo.
-- @return self
function SET_CARGO:AddCargo( Cargo ) --R2.4
self:Add( Cargo:GetName(), Cargo )
return self
end
--- (R2.1) Add CARGOs to SET_CARGO.
-- @param Core.Set#SET_CARGO self
-- @param #string AddCargoNames A single name or an array of CARGO names.

View File

@ -1892,7 +1892,7 @@ end
-- @param #CONTROLLABLE self
-- @return #CONTROLLABLE
function CONTROLLABLE:RouteStop()
self:F2()
self:F("RouteStop")
local CommandStop = self:CommandStopRoute( true )
self:SetCommand( CommandStop )
@ -1903,7 +1903,7 @@ end
-- @param #CONTROLLABLE self
-- @return #CONTROLLABLE
function CONTROLLABLE:RouteResume()
self:F2()
self:F("RouteResume")
local CommandResume = self:CommandStopRoute( false )
self:SetCommand( CommandResume )