mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Update Static.lua
This commit is contained in:
@@ -76,7 +76,7 @@ end
|
|||||||
-- @param #string StaticName Name of the DCS **Static** as defined within the Mission Editor.
|
-- @param #string StaticName Name of the DCS **Static** as defined within the Mission Editor.
|
||||||
-- @param #boolean RaiseError Raise an error if not found.
|
-- @param #boolean RaiseError Raise an error if not found.
|
||||||
-- @return #STATIC self or *nil*
|
-- @return #STATIC self or *nil*
|
||||||
function STATIC:FindByName( StaticName )
|
function STATIC:FindByName( StaticName, RaiseError )
|
||||||
|
|
||||||
-- Find static in DB.
|
-- Find static in DB.
|
||||||
local StaticFound = _DATABASE:FindStatic( StaticName )
|
local StaticFound = _DATABASE:FindStatic( StaticName )
|
||||||
@@ -87,6 +87,10 @@ function STATIC:FindByName( StaticName )
|
|||||||
if StaticFound then
|
if StaticFound then
|
||||||
return StaticFound
|
return StaticFound
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if RaiseError == nil or RaiseError == true then
|
||||||
|
error( "STATIC not found for: " .. StaticName )
|
||||||
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user