[Bug]: Aircraft get stuck in (human player's) air staging for unknown reason
- Dominant language
- Lua
- Stars
- 264
- Forks
- 260
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 21
Description
### Describe the Bug
In some games people have noticed that aircraft will dock at air staging and not automatically undock once repaired and refueled like they should. Instead, they have to be manually unloaded using the unload command by clicking on the aircraft in the transport storage display, and the yellow "deploy" command does not work.
This has been a long-standing bug without successes replicating it:
- Planes are not taking off from the airfield ([Discord](https://discord.com/channels/197033481883222026/1528864505625444493))
- Aircraft doesn't auto-release from air stages in the lategame ([Discord](https://discord.com/channels/197033481883222026/1322240211429883935)); replays [23908896](https://replay.faforever.com/23908896) 37:40 sainse, and [26100581](https://replay.faforever.com/26100581) 30:00
https://github.com/user-attachments/assets/1bc53132-f9f6-4972-bbfd-79b1ce9d992a
- Planes getting permanently stuck in air staging beacon ([Discord](https://discord.com/channels/197033481883222026/1205933573798895646)); replay 21820767 19:20 berrysdisciple
### Reproduce the bug
As mentioned, people haven't found a way to replicate the bug yet.
Some people say it is related to stalling resources.
ETFreeman said that it happened to him when he was using a normal dock command.
In my own testing mass stalls don't do anything because repairing doesn't cost mass, and energy stalls slow down repairing but don't affect unit behavior. Stalling resources does not affect refuel rate.
I was able to replicate a similar situation to the bug by issuing an order that makes aircraft dock (dock, patrol, attack move, guard orders) and then using ctrl+shift+right click to delete the order while aircraft were docked at the air staging, which caused the aircraft to not get out of the air staging automatically after they're done repairing.
My exact test setup was simply spawning 4 T3 mass extractors to stall energy and then using damaged ASF in various scenarios.
To damage the ASF, I used this script:
```lua
ConExecute([[SimLua
local s = DebugGetSelection()
for _, u in s do
u:SetHealth(u, u:GetMaxHealth() * 0.01)
end]])
```
The scenarios I've tested were:
1. manually deleting the orders that cause docking while aircraft were docked
2. Issuing a dock command that causes the ASF to fly over enemy aircraft, and then deleting the energy aircraft while the ASF were docked. The reasoning is that ASF automatically issue attack commands when they find targets and deleting the target while docked could be similar to deleting the command (although they wouldn't auto-initiate attack orders if they already have a command, so this is kind of a desperate guess to try to find a connection).
### Screenshots
_No response_
### Additional context
_No response_
Contributor guide
Research direction
Start by reviewing the reported replays 23908896, 26100581, and 21820767, then reproduce the listed dock, patrol, attack-move, and guard scenarios using the provided Lua damage script. Compare normal docking with deleting orders while aircraft are staged. Done means identifying a reliable trigger and ensuring repaired and refueled aircraft can undock without manual unload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100