Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -775,3 +775,4 @@ This page lists all the individual contributions to the project by their author.
- Wall overlay unit sell exploit fix
- Multiplayer gamespeed fix for RealTimeTimers
- Revert Ares patch to allow OpenTopped transport customization
- Fix for aircraft destroyed while crashing off-map not being cleaned up
1 change: 1 addition & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Fixed the bug that vehicle fall on infantry will make all cell content has been removed.
- Fixed buildings that have their owner changed during buildup skipping buildup and sometimes not correctly clearing the state.
- Fixed preplaced aircraft outside visible map being incorrectly flagged as crashing under certain conditions.
- Fixed aircraft destroyed while crashing off-map never being fully cleaned up, permanently blocking production slots and counting towards unit limits.
- Fixed `MovementZone=Subterannean` harvesters being unable to find docks if in area enclosed by water, cliffs etc.
- Fixed an issue where some effects pointing to a unit were not properly cleared when the unit changed its owner.
- Allow Reveal Crate to take effect when picking up by another player controlled house in campaign.
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ Phobos fixes:
- Fixed the bug that the upgrade building's power-enhancing effect depends only on its parent building and is not related to the upgrade building itself (by NetsuNegi)
- Fixed an issue where hover vehicles could not be destroyed after malfunctioning on water surfaces (by FlyStar)
- Fixed an issue where shadow matrix scaling was incorrectly applied to `TurretOffset` causing turret shadow misplacement (by Noble_Fish)
- Fixed aircraft destroyed while crashing off-map never being fully cleaned up, permanently blocking production slots and counting towards unit limits (by RAZER)

Fixes / interactions with other extensions:
<!-- - Allowed `AuxBuilding` and Ares' `SW.Aux/NegBuildings` to count building upgrades (by Ollerus) -->
Expand Down
19 changes: 19 additions & 0 deletions src/Misc/Hooks.BugFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2874,6 +2874,25 @@ DEFINE_HOOK(0x4DB874, FootClass_SetLocation_Extra, 0xA)
return SkipGameCode;
}

// Clean up dead aircraft stuck off-map after crash descent fails outside map bounds.
// FlyLocomotionClass guards crash position updates with an In_Radar check, so aircraft
// that die off-map never complete descent and never reach the UnInit() at the end of it.
DEFINE_HOOK(0x414DB6, AircraftClass_Update_CrashingOffMap, 0x6)
{
enum { ExitFunction = 0x4151B0 };

GET(AircraftClass* const, pThis, ESI);

if (pThis->IsCrashing && pThis->Health <= 0
&& !MapClass::Instance.IsWithinUsableArea(pThis->GetCoords()))
{
pThis->UnInit();
return ExitFunction;
}

return 0;
}

DEFINE_HOOK(0x4DEC7F, FootClass_Crash_FallingDownFix, 0x7)
{
GET(FootClass*, pThis, ESI);
Expand Down
Loading