Skip to content

[Vanilla Fix] Aircraft which crash offmap are not properly removed#2149

Open
CnCRAZER wants to merge 2 commits intoPhobos-developers:developfrom
CnCRAZER:ghost-aircraft-test-fix
Open

[Vanilla Fix] Aircraft which crash offmap are not properly removed#2149
CnCRAZER wants to merge 2 commits intoPhobos-developers:developfrom
CnCRAZER:ghost-aircraft-test-fix

Conversation

@CnCRAZER
Copy link
Contributor

This pull request addresses an important bug related to aircraft units destroyed while crashing off the visible map area. Previously, these aircraft were not properly cleaned up, which could permanently block production slots and incorrectly count toward unit limits. The fix ensures that such aircraft are now correctly removed from the game state. The main changes are as follows:

Bug Fixes and Cleanup:

  • Added logic in src/Misc/Hooks.BugFixes.cpp to detect aircraft that are destroyed while crashing off-map and force their cleanup by calling UnInit(). This prevents them from blocking production and unit limits.

Documentation Updates:

  • Updated docs/Fixed-or-Improved-Logics.md to describe the fix for aircraft destroyed while crashing off-map never being fully cleaned up.
  • Updated docs/Whats-New.md to mention the new fix for aircraft cleanup off-map.
  • Updated CREDITS.md to credit the contributor for the aircraft cleanup fix.

Add documentation and credit for a bug fix where aircraft destroyed while crashing off-map were not fully cleaned up, which could permanently block production slots and count toward unit limits. Updates CREDITS.md and adds entries to Fixed-or-Improved-Logics.md and Whats-New.md (credit to RAZER).
@github-actions
Copy link

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@NetsuNegi NetsuNegi added ❓Vanilla bug Vanilla game bugs that are requested to be fixed Needs testing ⚙️T1 T1 maintainer review is sufficient labels Mar 25, 2026
Copy link
Contributor

@TaranDahl TaranDahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What causes off-map or not to have different effects on crash behavior? The position you hooked doesn't seem to have such a difference.

@CnCRAZER
Copy link
Contributor Author

What causes off-map or not to have different effects on crash behavior? The position you hooked doesn't seem to have such a difference.

AFAIK offmap aircraft types are only removed if they are spawned from spawner or from teamtypes exiting the map. Running uninit to clear the unit from map is also only checked if aircraft type is within radar bounds

@CnCRAZER
Copy link
Contributor Author

CnCRAZER commented Mar 25, 2026

check the discord Phobos chat for the conversation regarding it

@TaranDahl
Copy link
Contributor

Repost:

I checked this. I think the location of the fix in your PR is incorrect.
I believe the root cause of the problem is at 4CD748. If it is outside the map, loco will refuse to set the location. Setting the layer and Mark are also rejected. It is unclear why such a judgment is made.
I think the correct approach should be to make a judgment at 4CD797, treating a crash outside the map the same as touching the ground, and performing subsequent detonation and unit deletion operations.
In addition, I'm afraid the crash of jumpjet has a similar problem (54CBC2). You'd better fix it while you're at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs testing ⚙️T1 T1 maintainer review is sufficient ❓Vanilla bug Vanilla game bugs that are requested to be fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants