mirror of
https://github.com/akaAgar/the-universal-mission-for-dcs-world.git
synced 2026-08-14 23:16:24 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
-- The "Any" faction has access to all units from all other factions
|
||||
do
|
||||
Library.factions.tables["Any"] = {}
|
||||
Library.factions.tables["Any"].theaters = {}
|
||||
Library.factions.tables["Any"].timePeriods = {}
|
||||
|
||||
Library.factions.tables["Any"].units = {}
|
||||
|
||||
local function copyUnitTableToAny(factionID, timePeriod)
|
||||
Library.factions.tables["Any"].units[timePeriod] = {}
|
||||
|
||||
for k,_ in pairs(Library.factions.tables[factionID].units[timePeriod]) do
|
||||
Library.factions.tables["Any"].units[timePeriod][k] = Library.factions.tables["Any"].units[timePeriod][k] or {}
|
||||
|
||||
for _,u in ipairs(Library.factions.tables[factionID].units[timePeriod][k]) do
|
||||
if not DCSEx.table.contains(Library.factions.tables["Any"].units[timePeriod][k], u) then
|
||||
table.insert(Library.factions.tables["Any"].units[timePeriod][k], u)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for k,_ in pairs(Library.factions.tables) do
|
||||
if k ~= "Any" then
|
||||
for _,tp in pairs(DCSEx.enums.timePeriod) do
|
||||
copyUnitTableToAny(k, tp)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user