Moose file changes

This commit is contained in:
FlightControl_Master
2018-05-10 20:00:50 +02:00
parent 0097316333
commit 6b31ad9645
8 changed files with 360 additions and 126 deletions

View File

@@ -4350,6 +4350,20 @@ function SET_CARGO:FirstCargoWithState( State )
return FirstCargo
end
function SET_CARGO:FirstCargoWithStateAndNotDeployed( State )
local FirstCargo = nil
for CargoName, Cargo in pairs( self.Set ) do
if Cargo:Is( State ) and not Cargo:IsDeployed() then
FirstCargo = Cargo
break
end
end
return FirstCargo
end
--- Iterate the SET_CARGO while identifying the first @{Cargo#CARGO} that is UnLoaded.
-- @param #SET_CARGO self
@@ -4360,6 +4374,15 @@ function SET_CARGO:FirstCargoUnLoaded()
end
--- Iterate the SET_CARGO while identifying the first @{Cargo#CARGO} that is UnLoaded and not Deployed.
-- @param #SET_CARGO self
-- @return Cargo.Cargo#CARGO The first @{Cargo#CARGO}.
function SET_CARGO:FirstCargoUnLoadedAndNotDeployed()
local FirstCargo = self:FirstCargoWithStateAndNotDeployed( "UnLoaded" )
return FirstCargo
end
--- Iterate the SET_CARGO while identifying the first @{Cargo#CARGO} that is Loaded.
-- @param #SET_CARGO self
-- @return Cargo.Cargo#CARGO The first @{Cargo#CARGO}.
@@ -4588,7 +4611,7 @@ function SET_ZONE:GetRandomZone()
local Index = self.Index
local ZoneFound = nil
while not ZoneFound do
while not ZoneFound do
local ZoneRandom = math.random( 1, #Index )
ZoneFound = self.Set[Index[ZoneRandom]]
end