predicted chainsaw state 2/2

unfortunately there's no reliable way due to *::Deploy not being called in certain scenarios but that should serve as good foundation for later improvement.

minor precision loss possibly due to addition being replaced with multiplication (ie. cycle + rate * interval -> ticks * rate * interval)
This commit is contained in:
explorer
2025-01-02 21:10:02 +03:00
parent f5fb3e4d30
commit 519d56c138
3 changed files with 31 additions and 73 deletions

View File

@ -1,12 +1,16 @@
__int32 Extra_Commands;
__int32 Chainsaw_Cycles;
void* Original_Move_Caller;
void Redirected_Move(float Unknown_Parameter, __int8 Final)
{
void* Local_Player = *(void**)((unsigned __int32)Client_Module + 7498712);
using Run_Prediction_Type = void(__cdecl*)();
if (*(void**)((unsigned __int32)Client_Module + 7498712) != nullptr)
if (Local_Player != nullptr)
{
Redirected_Read_Packets(Final);
@ -37,6 +41,17 @@ void Redirected_Move(float Unknown_Parameter, __int8 Final)
Run_Prediction_Type((unsigned __int32)Engine_Module + 527776)();
if (Local_Player != nullptr)
{
Chainsaw_Cycles += 1 + (Chainsaw_Cycles == 0);
static float Deploy_Time;
Chainsaw_Cycles *= *(float*)((unsigned __int32)Local_Player + 3872) == Deploy_Time;
Deploy_Time = *(float*)((unsigned __int32)Local_Player + 3872);
}
if (Extra_Commands > 0)
{
Extra_Commands -= 1;