Fix initiasiation on compiled
This commit is contained in:
+30
-20
@@ -279,8 +279,7 @@ function Database.New(Logger)
|
|||||||
return baseData
|
return baseData
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self:initAvailableUnits()
|
||||||
|
|
||||||
self:loadCapUnits()
|
self:loadCapUnits()
|
||||||
self:loadBlueSamUnits()
|
self:loadBlueSamUnits()
|
||||||
self:loadMissionzoneUnits()
|
self:loadMissionzoneUnits()
|
||||||
@@ -372,33 +371,44 @@ function Database.New(Logger)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
local is_group_taken = {}
|
local is_group_taken = {}
|
||||||
|
|
||||||
|
local getAvailableGroups = function()
|
||||||
|
local result = {}
|
||||||
|
for name, value in pairs(is_group_taken) do
|
||||||
|
if value == false then
|
||||||
|
table.insert(result, name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
local getAvailableCAPGroups = function()
|
||||||
|
local result = {}
|
||||||
|
for name, value in pairs(is_group_taken) do
|
||||||
|
if value == false and Spearhead.Util.startswith(name, "CAP") then
|
||||||
|
table.insert(result, name)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
---@private
|
||||||
|
function Database:initAvailableUnits()
|
||||||
do
|
do
|
||||||
local all_groups = Spearhead.DcsUtil.getAllGroupNames()
|
local all_groups = Spearhead.DcsUtil.getAllGroupNames()
|
||||||
for _, value in pairs(all_groups) do
|
for _, value in pairs(all_groups) do
|
||||||
is_group_taken[value] = false
|
is_group_taken[value] = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local getAvailableGroups = function()
|
|
||||||
local result = {}
|
|
||||||
for name, value in pairs(is_group_taken) do
|
|
||||||
if value == false then
|
|
||||||
table.insert(result, name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
|
|
||||||
local getAvailableCAPGroups = function()
|
|
||||||
local result = {}
|
|
||||||
for name, value in pairs(is_group_taken) do
|
|
||||||
if value == false and Spearhead.Util.startswith(name, "CAP") then
|
|
||||||
table.insert(result, name)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return result
|
|
||||||
end
|
|
||||||
|
|
||||||
---@private
|
---@private
|
||||||
function Database:loadCapUnits()
|
function Database:loadCapUnits()
|
||||||
|
|||||||
Reference in New Issue
Block a user