mirror of
https://github.com/iTracerFacer/Moose_TADC.git
synced 2026-07-16 14:32:30 +00:00
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:
+7
-11
@@ -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
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user