Fix XButtonHoming patch leaking state into other parameters (#640)

This commit is contained in:
Hyper 2025-03-02 22:42:25 +00:00 committed by GitHub
parent fe06134bb1
commit fd2fb745e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View file

@ -95,9 +95,11 @@ void PostUnleashMidAsmHook(PPCRegister& r30)
g_isUnleashCancelled = false; g_isUnleashCancelled = false;
} }
void SetXButtonHomingMidAsmHook(PPCRegister& r30) void SetXButtonHomingMidAsmHook(PPCRegister& r1)
{ {
r30.u32 = !Config::HomingAttackOnJump; auto pXButtonHoming = (bool*)(g_memory.base + r1.u32 + 0x63);
*pXButtonHoming = !Config::HomingAttackOnJump;
} }
// SWA::Player::CEvilSonicContext // SWA::Player::CEvilSonicContext

View file

@ -199,8 +199,8 @@ return_on_false = true
[[midasm_hook]] [[midasm_hook]]
name = "SetXButtonHomingMidAsmHook" name = "SetXButtonHomingMidAsmHook"
address = 0x8237AC88 address = 0x8237AC90
registers = ["r30"] registers = ["r1"]
# Down force HFR fix # Down force HFR fix
[[midasm_hook]] [[midasm_hook]]