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.
Task change: Switched from AttackGroup (general attack) to EngageGroup (air-to-air engagement), which is better suited for intercepting moving aircraft and encourages pursuit.