mirror of
https://github.com/akaAgar/the-universal-mission-for-dcs-world.git
synced 2025-11-25 19:31:01 +00:00
Added check so OCA missions can't be launched in zones without enemy airfields
This commit is contained in:
parent
83ddfe7598
commit
db5ee882c4
@ -69,7 +69,16 @@ do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
trigger.action.outText("Generating mission and loading assets, this can take some time...", 5)
|
-- If an OCA mission has been selected and the selected target zone doesn't contain any enemy airfield, default to ground attack
|
||||||
|
if TUM.settings.getValue(TUM.settings.id.TASKING) == DCSEx.enums.taskFamily.OCA then
|
||||||
|
local zone = DCSEx.zones.getByName(TUM.settings.getValue(TUM.settings.id.TARGET_LOCATION, true))
|
||||||
|
if #DCSEx.zones.getAirbases(zone, TUM.settings.getEnemyCoalition()) == 0 then
|
||||||
|
trigger.action.outText("OCA tasking selected in a zone without any enemy airfields, defaulting to GROUND ATTACK tasking.", 3)
|
||||||
|
TUM.settings.setValue(TUM.settings.id.TASKING, DCSEx.enums.taskFamily.GROUND_ATTACK, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
trigger.action.outText("Generating mission and loading assets, this can take some time...", 3)
|
||||||
|
|
||||||
-- Add a little delay for the "Generating mission..." message be printed out. Once generation begins, the main DCS thread will be to busy to output anything.
|
-- Add a little delay for the "Generating mission..." message be printed out. Once generation begins, the main DCS thread will be to busy to output anything.
|
||||||
timer.scheduleFunction(TUM.mission.beginMission, false, timer.getTime() + 1)
|
timer.scheduleFunction(TUM.mission.beginMission, false, timer.getTime() + 1)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user