fixed reference to mission editing warnings

This commit is contained in:
2024-10-11 20:47:38 +02:00
parent 50f5991604
commit 11fd746ed6
3 changed files with 13 additions and 16 deletions
+9 -9
View File
@@ -21,16 +21,16 @@ function CapBase:new(airbaseId, database, logger, capConfig, stageConfig)
if capConfig == nil then if capConfig == nil then
capConfig = {} capConfig = {}
table.insert(Spearhead.MissionEditingWarnings,"CapConfig is nil") Spearhead.AddMissionEditorWarning("CapConfig is nil")
else else
if capConfig.minSpeed == nil then Spearhead.MissionEditingWarnings("CapConfig.minSpeed is nil") end if capConfig.minSpeed == nil then Spearhead.AddMissionEditorWarning("CapConfig.minSpeed is nil") end
if capConfig.maxSpeed == nil then Spearhead.MissionEditingWarnings("CapConfig.maxSpeed is nil") end if capConfig.maxSpeed == nil then Spearhead.AddMissionEditorWarning("CapConfig.maxSpeed is nil") end
if capConfig.minAlt == nil then Spearhead.MissionEditingWarnings("CapConfig.minAlt is nil") end if capConfig.minAlt == nil then Spearhead.AddMissionEditorWarning("CapConfig.minAlt is nil") end
if capConfig.maxAlt == nil then Spearhead.MissionEditingWarnings("CapConfig.maxAlt is nil") end if capConfig.maxAlt == nil then Spearhead.AddMissionEditorWarning("CapConfig.maxAlt is nil") end
if capConfig.minDurationOnStation == nil then Spearhead.MissionEditingWarnings("CapConfig.minDurationOnStation is nil") end if capConfig.minDurationOnStation == nil then Spearhead.AddMissionEditorWarning("CapConfig.minDurationOnStation is nil") end
if capConfig.maxDurationOnStation == nil then Spearhead.MissionEditingWarnings("CapConfig.maxDurationOnStation is nil") end if capConfig.maxDurationOnStation == nil then Spearhead.AddMissionEditorWarning("CapConfig.maxDurationOnStation is nil") end
if capConfig.rearmDelay == nil then Spearhead.MissionEditingWarnings("CapConfig.rearmDelay is nil") end if capConfig.rearmDelay == nil then Spearhead.AddMissionEditorWarning("CapConfig.rearmDelay is nil") end
if capConfig.deathDelay == nil then Spearhead.MissionEditingWarnings("CapConfig.deathDelay is nil") end if capConfig.deathDelay == nil then Spearhead.AddMissionEditorWarning("CapConfig.deathDelay is nil") end
end end
o.activeCapStages = (stageConfig or {}).capActiveStages or 10 o.activeCapStages = (stageConfig or {}).capActiveStages or 10
+2 -3
View File
@@ -26,7 +26,7 @@ do
elseif first == "[" then elseif first == "[" then
result.isBackup = false result.isBackup = false
else else
table.insert(Spearhead.MissionEditingWarnings, "Could not parse the CAP config for group: " .. groupName) Spearhead.AddMissionEditorWarning("Could not parse the CAP config for group: " .. groupName)
return nil return nil
end end
@@ -62,8 +62,7 @@ do
end end
return result return result
else else
table.insert(Spearhead.MissionEditingWarnings, Spearhead.AddMissionEditorWarning("CAP Group with name: " .. groupName .. "should have at least 3 parts, but has " .. partCount)
"CAP Group with name: " .. groupName .. "should have at least 3 parts, but has " .. partCount)
return nil return nil
end end
end end
+2 -4
View File
@@ -881,13 +881,11 @@ do --setup route util
---@return table ---@return table
local function GetCAPTargetTypes(attackHelos) local function GetCAPTargetTypes(attackHelos)
local targetTypes = { local targetTypes = {
[1] = "Fighters", [1] = "Planes",
[2] = "Multirole fighters",
[3] = "Bombers",
} }
if attackHelos then if attackHelos then
targetTypes[4] = "Helicopters" targetTypes[2] = "Helicopters"
end end
return targetTypes return targetTypes