Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 1 addition & 49 deletions Client/multiplayer_sa/CMultiplayerSA_FrameRateFixes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,44 +162,6 @@ static void _declspec(naked) HOOK_CFallingGlassPane__Update_C()
}
}

#define HOOKPOS_CPhysical__ApplyAirResistance 0x544D29
#define HOOKSIZE_CPhysical__ApplyAirResistance 5
static const unsigned int RETURN_CPhysical__ApplyAirResistance = 0x544D4D;
static void _declspec(naked) HOOK_CPhysical__ApplyAirResistance()
{
_asm {
fld ds:[0x862CD0] // 0.99000001f
fld ds:[0xB7CB5C] // CTimer::ms_fTimeStep
fdiv kOriginalTimeStep // 1.666f
mov eax, 0x822130 // powf
call eax

fld st(0)
fmul [esi+0x50]
fstp [esi+0x50]

fld st(0)
fmul [esi+0x54]
fstp [esi+0x54]

fmul [esi+0x58]
fstp [esi+0x58]
jmp RETURN_CPhysical__ApplyAirResistance
}
}

template <unsigned int returnAddress>
static void _declspec(naked) HOOK_VehicleRapidStopFix()
{
static unsigned int RETURN_VehicleRapidStopFix = returnAddress;
_asm {
fld ds:[0xC2B9CC] // mod_HandlingManager.m_fWheelFriction
fmul ds:[0xB7CB5C] // CTimer::ms_fTimeStep
fdiv kOriginalTimeStep // 1.666f
jmp RETURN_VehicleRapidStopFix
}
}

#define HOOKPOS_CTimer__Update 0x561C5D
#define HOOKSIZE_CTimer__Update 0xE
static void _declspec(naked) HOOK_CTimer__Update()
Expand Down Expand Up @@ -600,17 +562,7 @@ void CMultiplayerSA::InitHooks_FrameRateFixes()
EZHookInstall(CFallingGlassPane__Update_A);
EZHookInstall(CFallingGlassPane__Update_B);
EZHookInstall(CFallingGlassPane__Update_C);
EZHookInstall(CPhysical__ApplyAirResistance);

// CVehicle::ProcessWheel
HookInstall(0x6D6E69, (DWORD)HOOK_VehicleRapidStopFix<0x6D6E6F>, 6);
HookInstall(0x6D6EA8, (DWORD)HOOK_VehicleRapidStopFix<0x6D6EAE>, 6);

// CVehicle::ProcessBikeWheel
HookInstall(0x6D767F, (DWORD)HOOK_VehicleRapidStopFix<0x6D7685>, 6);
HookInstall(0x6D76AB, (DWORD)HOOK_VehicleRapidStopFix<0x6D76B1>, 6);
HookInstall(0x6D76CD, (DWORD)HOOK_VehicleRapidStopFix<0x6D76D3>, 6);


// CCam::Process_FollowCar_SA
MemSet((void*)0x524FD7, 0x90, 0x1B);

Expand Down