diff --git a/CREDITS.md b/CREDITS.md index fbb87e8397..0b5547141b 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -706,6 +706,7 @@ This page lists all the individual contributions to the project by their author. - Weapon range finding in cylinder - Allow jumpjet climbing ignore building height - Fix an issue where the AI's regular targeting would also target garrisonable buildings + - Fix an issue that the move mission of the jumpjet does not end correctly - **solar-III (凤九歌)** - Target scanning delay customization (documentation) - Skip target scanning function calling for unarmed technos (documentation) diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index 6258ee8c8a..f6135f3aaa 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -302,6 +302,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - Vehicles overlapping `Wall=true` OverlayTypes no longer display sell cursor and cannot be sold. - Fixed vehicles disguised as trees incorrectly displaying veterancy insignia when they shouldn't. - Fixed the issue where the AI's regular targeting would also target garrisonable buildings. +- Fixed the issue that the move mission of the jumpjet does not end correctly. ## Fixes / interactions with other extensions diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 81bb10c619..1a7dd37d67 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -1254,6 +1254,7 @@ Vanilla fixes: - Allowed observers to see a selected building's radial indicator (by Trsdy) - Allow voxel projectiles to use `AnimPalette` and `FirersPalette` (by NetsuNegi) - Fixed the issue where the AI's regular targeting would also target garrisonable buildings (by TaranDahl) +- Fixed the issue that the move mission of the jumpjet does not end correctly (by TaranDahl) Phobos fixes: - Fixed shields being able to take damage when the parent TechnoType was under effects of a `Temporal` Warhead (by Starkku) diff --git a/src/Misc/Hooks.BugFixes.cpp b/src/Misc/Hooks.BugFixes.cpp index 941dd90b55..bca64a24a4 100644 --- a/src/Misc/Hooks.BugFixes.cpp +++ b/src/Misc/Hooks.BugFixes.cpp @@ -3089,3 +3089,19 @@ DEFINE_HOOK(0x6F833E, TechnoClass_CanAutoTargetObject_Garrisonable, 0x6) R->AL(garrisonable && (isFullMap || pThis->MegaMissionIsAttackMove())); // Attack move is allowed because it can switch to Mission::Attack return 0; } + +// Fix the issue that the movement mission of jumpjet does not end correctly. +DEFINE_HOOK(0x4D4203, FootClass_MissionMove_EndCheckFix1, 0x6) +{ + GET(FootClass*, pThis, ESI); + R->EAX(pThis->Destination && (!locomotion_cast(pThis->Locomotor) || pThis->DistanceFrom(pThis->Destination) > Unsorted::LeptonsPerCell)); + return 0x4D4209; +} + +// Replace IsMoving by IsMovingNow. +DEFINE_HOOK(0x4D4221, FootClass_MissionMove_EndCheckFix2, 0x6) +{ + GET(FootClass*, pThis, ESI); + R->AL(pThis->Locomotor.GetInterfacePtr()->Is_Moving_Now()); + return 0x4D422D; +}