Altitude fix: Interceptors now route to the threat's exact altitude instead of a fixed squadron altitude. This prevents them flying "over" low-altitude targets without engaging.

Task change: Switched from AttackGroup (general attack) to EngageGroup (air-to-air engagement), which is better suited for intercepting moving aircraft and encourages pursuit.
This commit is contained in:
iTracerFacer
2025-12-06 11:23:34 -06:00
parent 6232cafa25
commit 4ba3fdea2b
2 changed files with 3159 additions and 11 deletions
+7 -11
View File
@@ -1815,18 +1815,14 @@ local function launchInterceptor(threatGroup, coalitionSide)
-- Route to threat
local currentThreatCoord = safeCoordinate(threatGroup)
if currentThreatCoord then
local okIntercept, interceptCoord = pcall(function()
return currentThreatCoord:SetAltitude(squadron.altitude * 0.3048)
local interceptCoord = currentThreatCoord -- Use threat's current altitude for intercept
pcall(function()
interceptor:RouteAirTo(interceptCoord, squadron.speed * 0.5144, "BARO")
end)
if okIntercept and interceptCoord then
pcall(function()
interceptor:RouteAirTo(interceptCoord, squadron.speed * 0.5144, "BARO")
end)
end
-- Attack the threat
local attackTask = {
id = 'AttackGroup',
-- Engage the threat
local engageTask = {
id = 'EngageGroup',
params = {
groupId = threatGroup:GetID(),
weaponType = 'Auto',
@@ -1834,7 +1830,7 @@ local function launchInterceptor(threatGroup, coalitionSide)
priority = 1
}
}
interceptor:PushTask(attackTask, 1)
interceptor:PushTask(engageTask, 1)
end
end
end, {}, 3)
+3152
View File
File diff suppressed because it is too large Load Diff