diff --git a/CREDITS.md b/CREDITS.md index 0b5547141b..f991118727 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -707,6 +707,7 @@ This page lists all the individual contributions to the project by their author. - 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 + - Fix the issue that the Jumpjet must end its movement before starting the next mission - **solar-III (凤九歌)** - Target scanning delay customization (documentation) - Skip target scanning function calling for unarmed technos (documentation) diff --git a/YRpp b/YRpp index 53447ad735..f230f9cf76 160000 --- a/YRpp +++ b/YRpp @@ -1 +1 @@ -Subproject commit 53447ad7355b27d4b5e8a87d0ac543459d3039fc +Subproject commit f230f9cf766311d063905cd1c2a53cb43a75f4d5 diff --git a/docs/Fixed-or-Improved-Logics.md b/docs/Fixed-or-Improved-Logics.md index f6135f3aaa..13cfae2f2e 100644 --- a/docs/Fixed-or-Improved-Logics.md +++ b/docs/Fixed-or-Improved-Logics.md @@ -303,6 +303,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho - 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. +- Fixed the issue that the Jumpjet must end its movement before starting the next mission. ## Fixes / interactions with other extensions diff --git a/docs/Whats-New.md b/docs/Whats-New.md index 1a7dd37d67..b5a262ef63 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -601,6 +601,7 @@ Vanilla fixes: - Fixed the bug that techno in attack move will move to target if it cannot attack it (by NetsuNegi) - Fixed the bug in AI scripts 56 and 57 that forced the launch of superweapons with index numbers 3 and 4 (by FlyStar) - Buildings with `NeedsEngineer=true` are now considered to have threat value of 0 under ownership of `MultiplayPassive=true` houses regardless of their `ThreatPosed` value (by Starkku) +- Fixed the issue that the Jumpjet must end its movement before starting the next mission (by TaranDahl) Phobos fixes: - Fixed the bug that `AllowAirstrike=no` cannot completely prevent air strikes from being launched against it (by NetsuNegi) diff --git a/src/Misc/Hooks.BugFixes.cpp b/src/Misc/Hooks.BugFixes.cpp index bca64a24a4..c7d2a94d46 100644 --- a/src/Misc/Hooks.BugFixes.cpp +++ b/src/Misc/Hooks.BugFixes.cpp @@ -3105,3 +3105,22 @@ DEFINE_HOOK(0x4D4221, FootClass_MissionMove_EndCheckFix2, 0x6) R->AL(pThis->Locomotor.GetInterfacePtr()->Is_Moving_Now()); return 0x4D422D; } + +// According to the code comments of the open-sourced RA1, I believe that the check of IsMovingNow here is to prevent foots from starting a new mission at an unstoppable position in the cell. +// Then it is obvious that Jumpjet should not perform this check because Jumpjet's movement does not take the cell into account. +DEFINE_HOOK_AGAIN(0x521BA7, FootClass_ReadyToNextMission_MovingCheck, 0x6); // Infantry +DEFINE_HOOK(0x7442D6, FootClass_ReadyToNextMission_MovingCheck, 0x6) // Unit +{ + GET(FootClass*, pThis, ESI); + auto pLoco = pThis->Locomotor.GetInterfacePtr(); + R->AL(!locomotion_cast(pLoco) && pLoco->Is_Moving_Now()); + return R->Origin() + 0xF; +} + +// Although this may seem useless because locomotor also checks IsFallingDown. But just in case. +DEFINE_HOOK(0x7442AB, UnitClass_ReadyToNextMission_FallingDown, 0x6) +{ + enum { ReturnZero = 0x744383 }; + GET(FootClass*, pThis, ESI); + return pThis->IsFallingDown ? ReturnZero : 0; +}