Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 @@ -690,6 +690,7 @@ This page lists all the individual contributions to the project by their author.
- Fix an issue where units recruited by a team with `AreTeamMembersRecruitable=false` cannot be recruited even if they have been liberated by that team
- Global default value for `DefaultToGuardArea`
- Weapon range finding in cylinder
- 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)
Expand Down
1 change: 1 addition & 0 deletions docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ This page describes all ingame logics that are fixed or improved in Phobos witho
- Fixed the bug where selected technos would lose their selection if their regular mind control was replaced with permanent mind control or with the control from the Psychic Dominator superweapon.
- Fixed the issue where units recruited by a team with `AreTeamMembersRecruitable=false` cannot be recruited even if they have been liberated by that team.
- Allow the default value of `DefaultToGuardArea` to be defined by `[General] -> DefaultToGuardArea`.
- Fixed the issue that the Jumpjet must end its movement before starting the next mission.

## Fixes / interactions with other extensions

Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ Vanilla fixes:
- Fixed the bug where selected technos would lose their selection if their regular mind control was replaced with permanent mind control or with the control from the Psychic Dominator superweapon (by NetsuNegi)
- Fixed an issue that retaliation will make the unit keep switching among multiple targets with the same amount of threat (by TaranDahl)
- Fixed the issue where units recruited by a team with `AreTeamMembersRecruitable=false` cannot be recruited even if they have been liberated by that team (by TaranDahl)
- 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)
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 @@ -2971,3 +2971,22 @@ DEFINE_HOOK(0x6EA870, TeamClass_LiberateMember_Start, 0x6)
pMember->RecruitableB = true;
return 0;
}

// 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<JumpjetLocomotionClass*>(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;
}