[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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 6 deletions

2
deps/GSL vendored

@ -1 +1 @@
Subproject commit 9851b94d7e28113af9e41576f065b993f13e2d7c Subproject commit 3ba80d5dd465828909e1ee756b8c437d5e820ccc

View File

@ -105,27 +105,40 @@ namespace Components
__asm __asm
{ {
// Check the value of BGBounces // Check the value of BGBounces
push ecx
push eax push eax
mov eax, BGBounces mov eax, BGBounces
mov ecx, dword ptr [eax + 0x10] mov eax, dword ptr [eax + 0x10]
test ecx, ecx test eax, eax
pop eax pop eax
pop ecx
// Do not bounce if BGBounces is 0 // Do not bounce if BGBounces is 0
jle noBounce 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 // Bounce
regularBounce:
push 0x4B1B34 push 0x4B1B34
ret ret
noBounce: noBounce:
// Original game code // Original game code
cmp dword ptr [esp + 0x24], 0 cmp dword ptr [esp + 0x24], 0
push 0x4B1B48 push 0x4B1B32
ret ret
} }
} }