mirror of
https://github.com/iTracerFacer/Moose_TADC.git
synced 2026-08-17 03:11:20 +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
|
-- Route to threat
|
||||||
local currentThreatCoord = safeCoordinate(threatGroup)
|
local currentThreatCoord = safeCoordinate(threatGroup)
|
||||||
if currentThreatCoord then
|
if currentThreatCoord then
|
||||||
local okIntercept, interceptCoord = pcall(function()
|
local interceptCoord = currentThreatCoord -- Use threat's current altitude for intercept
|
||||||
return currentThreatCoord:SetAltitude(squadron.altitude * 0.3048)
|
pcall(function()
|
||||||
|
interceptor:RouteAirTo(interceptCoord, squadron.speed * 0.5144, "BARO")
|
||||||
end)
|
end)
|
||||||
if okIntercept and interceptCoord then
|
|
||||||
pcall(function()
|
|
||||||
interceptor:RouteAirTo(interceptCoord, squadron.speed * 0.5144, "BARO")
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Attack the threat
|
-- Engage the threat
|
||||||
local attackTask = {
|
local engageTask = {
|
||||||
id = 'AttackGroup',
|
id = 'EngageGroup',
|
||||||
params = {
|
params = {
|
||||||
groupId = threatGroup:GetID(),
|
groupId = threatGroup:GetID(),
|
||||||
weaponType = 'Auto',
|
weaponType = 'Auto',
|
||||||
@@ -1834,7 +1830,7 @@ local function launchInterceptor(threatGroup, coalitionSide)
|
|||||||
priority = 1
|
priority = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
interceptor:PushTask(attackTask, 1)
|
interceptor:PushTask(engageTask, 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end, {}, 3)
|
end, {}, 3)
|
||||||
|
|||||||
+3152
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user