Updates Misc

This commit is contained in:
Frank
2020-04-24 16:03:28 +02:00
parent df512f7a58
commit 7360c51a8f
10 changed files with 1026 additions and 517 deletions

View File

@@ -4,7 +4,7 @@
--
-- ### Author: **FlightControl**
--
-- ### Contributions:
-- ### Contributions: **funkyfranky**
--
-- ===
--
@@ -48,6 +48,10 @@ STATIC = {
}
--- Register a static object.
-- @param #STATIC self
-- @param #string StaticName Name of the static object.
-- @return #STATIC self
function STATIC:Register( StaticName )
local self = BASE:Inherit( self, POSITIONABLE:New( StaticName ) )
self.StaticName = StaticName
@@ -71,21 +75,19 @@ end
-- @param #STATIC self
-- @param #string StaticName Name of the DCS **Static** as defined within the Mission Editor.
-- @param #boolean RaiseError Raise an error if not found.
-- @return #STATIC
function STATIC:FindByName( StaticName, RaiseError )
-- @return #STATIC self or *nil*
function STATIC:FindByName( StaticName )
-- Find static in DB.
local StaticFound = _DATABASE:FindStatic( StaticName )
-- Set static name.
self.StaticName = StaticName
if StaticFound then
StaticFound:F3( { StaticName } )
return StaticFound
end
if RaiseError == nil or RaiseError == true then
error( "STATIC not found for: " .. StaticName )
end
return nil
end