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
{
int SlowMotion::Delay = 0;
DWORD applySlowMotionHookLoc = 0x60B2D0;
void SlowMotion::ApplySlowMotion(int timePassed)
void SlowMotion::ApplySlowMotionStub(int timePassed)
{
if (SlowMotion::Delay <= 0)
{
Utils::Hook::Call<void(int)>(0x60B2D0)(timePassed);
__asm
{
push timePassed
call applySlowMotionHookLoc
add esp, 4h
}
}
else
{
SlowMotion::Delay -= timePassed;
}
}
__declspec(naked) void SlowMotion::ApplySlowMotionStub()
{
__asm
{
pushad
push [esp + 20h]
call SlowMotion::ApplySlowMotion
pop ecx
popad
retn
}
}
void SlowMotion::SetSlowMotion()
{
int duration = 1000;
@ -91,4 +78,4 @@ namespace Components
Utils::Hook(0x4A54ED, SlowMotion::DrawConnectionInterruptedStub, HOOK_CALL).install()->quick();
Utils::Hook(0x4A54FB, SlowMotion::DrawConnectionInterruptedStub, HOOK_CALL).install()->quick();
}
}
}

View File

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