Fix initiasiation on compiled
This commit is contained in:
@@ -279,8 +279,7 @@ function Database.New(Logger)
|
||||
return baseData
|
||||
end
|
||||
|
||||
|
||||
|
||||
self:initAvailableUnits()
|
||||
self:loadCapUnits()
|
||||
self:loadBlueSamUnits()
|
||||
self:loadMissionzoneUnits()
|
||||
@@ -372,13 +371,8 @@ function Database.New(Logger)
|
||||
|
||||
end
|
||||
|
||||
|
||||
local is_group_taken = {}
|
||||
do
|
||||
local all_groups = Spearhead.DcsUtil.getAllGroupNames()
|
||||
for _, value in pairs(all_groups) do
|
||||
is_group_taken[value] = false
|
||||
end
|
||||
end
|
||||
|
||||
local getAvailableGroups = function()
|
||||
local result = {}
|
||||
@@ -390,6 +384,7 @@ local is_group_taken = {}
|
||||
return result
|
||||
end
|
||||
|
||||
|
||||
local getAvailableCAPGroups = function()
|
||||
local result = {}
|
||||
for name, value in pairs(is_group_taken) do
|
||||
@@ -400,6 +395,21 @@ local is_group_taken = {}
|
||||
return result
|
||||
end
|
||||
|
||||
---@private
|
||||
function Database:initAvailableUnits()
|
||||
do
|
||||
local all_groups = Spearhead.DcsUtil.getAllGroupNames()
|
||||
for _, value in pairs(all_groups) do
|
||||
is_group_taken[value] = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
---@private
|
||||
function Database:loadCapUnits()
|
||||
local all_groups = getAvailableCAPGroups()
|
||||
|
||||
Reference in New Issue
Block a user