[PM]: Jump to different address on allAngles (#790)

This commit is contained in:
Edo
2023-02-22 00:04:30 +01:00
committed by GitHub
parent eb5218e252
commit 1d59a63c71
2 changed files with 19 additions and 6 deletions

2
deps/GSL vendored

Submodule deps/GSL updated: 9851b94d7e...3ba80d5dd4

View File

@ -105,27 +105,40 @@ namespace Components
__asm
{
// Check the value of BGBounces
push ecx
push eax
mov eax, BGBounces
mov ecx, dword ptr [eax + 0x10]
test ecx, ecx
mov eax, dword ptr [eax + 0x10]
test eax, eax
pop eax
pop ecx
// Do not bounce if BGBounces is 0
jle noBounce
push eax
mov eax, BGBouncesAllAngles
mov eax, dword ptr [eax + 0x10]
test eax, eax
pop eax
// Do not apply all angles patch if BGBouncesAllAngles is 0
jle regularBounce
push 0x4B1B7D
ret
// Bounce
regularBounce:
push 0x4B1B34
ret
noBounce:
// Original game code
cmp dword ptr [esp + 0x24], 0
push 0x4B1B48
push 0x4B1B32
ret
}
}