-- Fixed NearRadius.

-- Some documentation errors.
This commit is contained in:
FlightControl 2018-09-27 22:08:08 +02:00
parent 2dc7ca0cb2
commit 5becf001ba
8 changed files with 19 additions and 22 deletions

View File

@ -471,7 +471,7 @@ do -- CARGO
self.CargoLimit = 0
self.LoadRadius = LoadRadius or 500
self.NearRadius = NearRadius or 25
--self.NearRadius = NearRadius or 25
self:SetDeployed( false )

View File

@ -67,6 +67,8 @@ do -- CARGO_CRATE
self:HandleEvent( EVENTS.PlayerLeaveUnit, self.OnEventCargoDead )
self:SetEventPriority( 4 )
self.NearRadius = NearRadius or 25
return self
end

View File

@ -64,6 +64,8 @@ do -- CARGO_GROUP
self.Grouped = true
self.CargoUnitTemplate = {}
self.NearRadius = NearRadius
self:SetDeployed( false )
local WeightGroup = 0
@ -297,9 +299,9 @@ do -- CARGO_GROUP
-- @param Wrapper.Unit#UNIT CargoCarrier
-- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier.
function CARGO_GROUP:onenterBoarding( From, Event, To, CargoCarrier, NearRadius, ... )
--self:F( { CargoCarrier.UnitName, From, Event, To } )
self:F( { CargoCarrier.UnitName, From, Event, To, NearRadius = NearRadius } )
local NearRadius = NearRadius or 25
NearRadius = NearRadius or self.NearRadius
if From == "UnLoaded" then
@ -347,8 +349,6 @@ do -- CARGO_GROUP
function CARGO_GROUP:onafterBoarding( From, Event, To, CargoCarrier, NearRadius, ... )
--self:F( { CargoCarrier.UnitName, From, Event, To } )
local NearRadius = NearRadius or 100
local Boarded = true
local Cancelled = false
local Dead = true

View File

@ -60,6 +60,8 @@ do -- CARGO_SLINGLOAD
self:HandleEvent( EVENTS.PlayerLeaveUnit, self.OnEventCargoDead )
self:SetEventPriority( 4 )
self.NearRadius = NearRadius or 25
return self
end

View File

@ -69,8 +69,6 @@ do -- CARGO_UNIT
function CARGO_UNIT:onenterUnBoarding( From, Event, To, ToPointVec2, NearRadius )
self:F( { From, Event, To, ToPointVec2, NearRadius } )
NearRadius = NearRadius or 25
local Angle = 180
local Speed = 60
local DeployDistance = 9
@ -139,8 +137,6 @@ do -- CARGO_UNIT
function CARGO_UNIT:onleaveUnBoarding( From, Event, To, ToPointVec2, NearRadius )
self:F( { From, Event, To, ToPointVec2, NearRadius } )
NearRadius = NearRadius or 100
local Angle = 180
local Speed = 10
local Distance = 5
@ -167,8 +163,6 @@ do -- CARGO_UNIT
function CARGO_UNIT:onafterUnBoarding( From, Event, To, ToPointVec2, NearRadius )
self:F( { From, Event, To, ToPointVec2, NearRadius } )
NearRadius = NearRadius or 100
self.CargoInAir = self.CargoObject:InAir()
self:T( self.CargoInAir )
@ -227,7 +221,7 @@ do -- CARGO_UNIT
-- @param #string From
-- @param #string To
function CARGO_UNIT:onafterBoard( From, Event, To, CargoCarrier, NearRadius, ... )
self:F( { From, Event, To, CargoCarrier, NearRadius } )
self:F( { From, Event, To, CargoCarrier, NearRadius = NearRadius } )
self.CargoInAir = self.CargoObject:InAir()
@ -271,7 +265,7 @@ do -- CARGO_UNIT
local TaskRoute = self.CargoObject:TaskRoute( Points )
self.CargoObject:SetTask( TaskRoute, 2 )
self:__Boarding( -5, CargoCarrier, NearRadius )
self:__Boarding( -5, CargoCarrier, NearRadius, ... )
self.RunCount = 0
end
end
@ -288,7 +282,7 @@ do -- CARGO_UNIT
-- @param Wrapper.Client#CLIENT CargoCarrier
-- @param #number NearRadius Default 25 m.
function CARGO_UNIT:onafterBoarding( From, Event, To, CargoCarrier, NearRadius, ... )
self:F( { From, Event, To, CargoCarrier:GetName() } )
self:F( { From, Event, To, CargoCarrier:GetName(), NearRadius = NearRadius } )
if CargoCarrier and CargoCarrier:IsAlive() and self.CargoObject and self.CargoObject:IsAlive() then
@ -298,11 +292,11 @@ do -- CARGO_UNIT
self:__Load( 1, CargoCarrier, ... )
else
if self:IsNear( CargoCarrier:GetPointVec2(), 20 ) then
self:__Boarding( -2, CargoCarrier, NearRadius, ... )
self.RunCount = self.RunCount + 2
self:__Boarding( -1, CargoCarrier, NearRadius, ... )
self.RunCount = self.RunCount + 1
else
self:__Boarding( -10, CargoCarrier, NearRadius, ... )
self.RunCount = self.RunCount + 10
self:__Boarding( -5, CargoCarrier, NearRadius, ... )
self.RunCount = self.RunCount + 5
end
if self.RunCount >= 40 then
self.RunCount = 0

View File

@ -805,8 +805,7 @@ do -- FSM_CONTROLLABLE
--
-- ===
--
-- @field #FSM_CONTROLLABLE FSM_CONTROLLABLE
--
-- @field #FSM_CONTROLLABLE
FSM_CONTROLLABLE = {
ClassName = "FSM_CONTROLLABLE",
}

View File

@ -1017,7 +1017,7 @@ do -- TASK_CARGO
else
Cargo:MessageToGroup( "Boarding ...", TaskUnit:GetGroup() )
if not Cargo:IsBoarding() then
Cargo:Board( TaskUnit, 20, self )
Cargo:Board( TaskUnit, nil, self )
end
end
else

View File

@ -13,9 +13,9 @@
--- @type CONTROLLABLE
-- @extends Wrapper.Positionable#POSITIONABLE
-- @field DCS#Controllable DCSControllable The DCS controllable class.
-- @field #string ControllableName The name of the controllable.
-- @extends Wrapper.Positionable#POSITIONABLE