This commit is contained in:
Frank
2020-06-10 21:17:03 +02:00
parent 9d3341ab9f
commit 4227186383
2 changed files with 14 additions and 7 deletions
+8 -1
View File
@@ -1275,9 +1275,16 @@ end
--- Get a flight group from the data base.
-- @param #DATABASE self
-- @param #string groupname Group name of the flight group.
-- @param #string groupname Group name of the flight group. Can also be passed as GROUP object.
-- @return Ops.FlightGroup#FLIGHTGROUP Flight group object.
function DATABASE:GetFlightGroup(groupname)
-- Get group and group name.
if type(groupname)=="string" then
else
groupname=groupname:GetName()
end
return self.FLIGHTGROUPS[groupname]
end
+6 -6
View File
@@ -229,21 +229,21 @@ FLIGHTGROUP.version="0.5.0"
--- Create a new FLIGHTGROUP object and start the FSM.
-- @param #FLIGHTGROUP self
-- @param #string groupname Name of the group.
-- @param Wrapper.Group#GROUP group The group object. Can also be given as #string with the name of the group
-- @param #string autostart (Optional) If `true` or `nil` automatically start the FSM (default). If `false`, use FLIGHTGROUP:Start() manually.
-- @return #FLIGHTGROUP self
function FLIGHTGROUP:New(groupname, autostart)
function FLIGHTGROUP:New(group, autostart)
-- First check if we already have a flight group for this group.
local fg=_DATABASE:GetFlightGroup(groupname)
local fg=_DATABASE:GetFlightGroup(group)
if fg then
fg:I(fg.lid..string.format("WARNING: Flight group %s already exists in data base!", groupname))
fg:I(fg.lid..string.format("WARNING: Flight group already exists in data base!"))
return fg
end
-- Inherit everything from FSM class.
local self=BASE:Inherit(self, OPSGROUP:New(groupname)) -- #FLIGHTGROUP
local self=BASE:Inherit(self, OPSGROUP:New(group)) -- #FLIGHTGROUP
-- Set some string id for output to DCS.log file.
self.lid=string.format("FLIGHTGROUP %s | ", self.groupname)