What the fix does:
Before cleanup: Checks if the aircraft is still assigned to any active threats
If still engaged: Skips cleanup and logs "still engaged in combat"
If not engaged: Proceeds with cleanup normally
How it works:
When the 2-hour timer fires, the system now:
✅ Checks the assignedThreats table to see if this aircraft is still hunting enemies
✅ Only destroys aircraft that have completed their mission or are no longer assigned
✅ Keeps aircraft alive if they're still actively dogfighting
Result:
RED FW190s chasing you won't vanish mid-combat anymore
Aircraft will only be cleaned up after they're done fighting
The safety net still exists for stuck/orphaned aircraft that never RTB
This preserves the emergency cleanup functionality while preventing the frustrating mid-combat disappearances you experienced. The aircraft will now fight until the threat is eliminated, then clean up naturally through the RTB system.
Give aircraft 10 full minutes to taxi and take off before declaring them stuck
Prevent multiple aircraft from spawning simultaneously at the same airbase
Provide detailed diagnostic information about stuck aircraft (including speed)
Log when aircraft successfully take off for better visibility
Issue warnings after 3 failures at any specific airbase
Task change: Switched from AttackGroup (general attack) to EngageGroup (air-to-air engagement), which is better suited for intercepting moving aircraft and encourages pursuit.
Task change: Switched from AttackGroup (general attack) to EngageGroup (air-to-air engagement), which is better suited for intercepting moving aircraft and encourages pursuit.