slowmofix

This commit is contained in:
zweej 2021-08-15 00:10:42 +02:00
parent 830a60c8c9
commit de0b8adc82
2 changed files with 11 additions and 25 deletions

View File

@ -3,35 +3,22 @@
namespace Components namespace Components
{ {
int SlowMotion::Delay = 0; int SlowMotion::Delay = 0;
DWORD applySlowMotionHookLoc = 0x60B2D0;
void SlowMotion::ApplySlowMotion(int timePassed) void SlowMotion::ApplySlowMotionStub(int timePassed)
{ {
if (SlowMotion::Delay <= 0) if (SlowMotion::Delay <= 0)
{ {
Utils::Hook::Call<void(int)>(0x60B2D0)(timePassed); __asm
{
push timePassed
call applySlowMotionHookLoc
add esp, 4h
}
} }
else else
{
SlowMotion::Delay -= timePassed; SlowMotion::Delay -= timePassed;
}
} }
__declspec(naked) void SlowMotion::ApplySlowMotionStub()
{
__asm
{
pushad
push [esp + 20h]
call SlowMotion::ApplySlowMotion
pop ecx
popad
retn
}
}
void SlowMotion::SetSlowMotion() void SlowMotion::SetSlowMotion()
{ {
int duration = 1000; int duration = 1000;

View File

@ -14,8 +14,7 @@ namespace Components
static int Delay; static int Delay;
static void SetSlowMotion(); static void SetSlowMotion();
static void ApplySlowMotion(int timePassed); static void ApplySlowMotionStub(int timePassed);
static void ApplySlowMotionStub();
static void DrawConnectionInterruptedStub(int a1); static void DrawConnectionInterruptedStub(int a1);
}; };