[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
{
// 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
}
}