From 1d59a63c718cf13e0e8bc405c00be3aad1698423 Mon Sep 17 00:00:00 2001 From: Edo Date: Wed, 22 Feb 2023 00:04:30 +0100 Subject: [PATCH] [PM]: Jump to different address on allAngles (#790) --- deps/GSL | 2 +- src/Components/Modules/PlayerMovement.cpp | 23 ++++++++++++++++++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/deps/GSL b/deps/GSL index 9851b94d..3ba80d5d 160000 --- a/deps/GSL +++ b/deps/GSL @@ -1 +1 @@ -Subproject commit 9851b94d7e28113af9e41576f065b993f13e2d7c +Subproject commit 3ba80d5dd465828909e1ee756b8c437d5e820ccc diff --git a/src/Components/Modules/PlayerMovement.cpp b/src/Components/Modules/PlayerMovement.cpp index b57a2729..c624d908 100644 --- a/src/Components/Modules/PlayerMovement.cpp +++ b/src/Components/Modules/PlayerMovement.cpp @@ -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 } }