Skip to content

Commit 412848a

Browse files
xen-000Vauff
authored andcommitted
Remove all subtick moves instead of zeroing them
Also update detour definition as it's actually a controller that's passed, which makes more sense
1 parent 28dcd75 commit 412848a

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

src/detours.cpp

+4-11
Original file line numberDiff line numberDiff line change
@@ -487,27 +487,20 @@ class CUserCmd
487487
#endif
488488
};
489489

490-
void* FASTCALL Detour_ProcessUsercmds(CBasePlayerPawn *pPawn, CUserCmd *cmds, int numcmds, bool paused, float margin)
490+
void* FASTCALL Detour_ProcessUsercmds(CCSPlayerController *pController, CUserCmd *cmds, int numcmds, bool paused, float margin)
491491
{
492492
// Push fix only works properly if subtick movement is also disabled
493493
if (!g_bDisableSubtick && !g_bUseOldPush)
494-
return ProcessUsercmds(pPawn, cmds, numcmds, paused, margin);
494+
return ProcessUsercmds(pController, cmds, numcmds, paused, margin);
495495

496496
VPROF_SCOPE_BEGIN("Detour_ProcessUsercmds");
497497

498-
static int offset = g_GameConfig->GetOffset("UsercmdOffset");
499-
500498
for (int i = 0; i < numcmds; i++)
501-
{
502-
CSGOUserCmdPB *pUserCmd = &cmds[i].cmd;
503-
504-
for (int j = 0; j < pUserCmd->mutable_base()->subtick_moves_size(); j++)
505-
pUserCmd->mutable_base()->mutable_subtick_moves(j)->set_when(0.f);
506-
}
499+
cmds[i].cmd.mutable_base()->mutable_subtick_moves()->Clear();
507500

508501
VPROF_SCOPE_END();
509502

510-
return ProcessUsercmds(pPawn, cmds, numcmds, paused, margin);
503+
return ProcessUsercmds(pController, cmds, numcmds, paused, margin);
511504
}
512505

513506
void FASTCALL Detour_CGamePlayerEquip_InputTriggerForAllPlayers(CGamePlayerEquip* pEntity, InputData_t* pInput)

src/detours.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ bool FASTCALL Detour_CCSPlayer_WeaponServices_CanUse(CCSPlayer_WeaponServices *,
6060
bool FASTCALL Detour_CEntityIdentity_AcceptInput(CEntityIdentity* pThis, CUtlSymbolLarge* pInputName, CEntityInstance* pActivator, CEntityInstance* pCaller, variant_t* value, int nOutputID);
6161
void* FASTCALL Detour_CNavMesh_GetNearestNavArea(int64_t unk1, float* unk2, unsigned int* unk3, unsigned int unk4, int64_t unk5, int64_t unk6, float unk7, int64_t unk8);
6262
void FASTCALL Detour_ProcessMovement(CCSPlayer_MovementServices *pThis, void *pMove);
63-
void *FASTCALL Detour_ProcessUsercmds(CBasePlayerPawn *pawn, CUserCmd *cmds, int numcmds, bool paused, float margin);
63+
void *FASTCALL Detour_ProcessUsercmds(CCSPlayerController *pController, CUserCmd *cmds, int numcmds, bool paused, float margin);
6464
void FASTCALL Detour_CGamePlayerEquip_InputTriggerForAllPlayers(CGamePlayerEquip*, InputData_t*);
6565
void FASTCALL Detour_CGamePlayerEquip_InputTriggerForActivatedPlayer(CGamePlayerEquip*, InputData_t*);
6666
int64_t* FASTCALL Detour_CCSGameRules_GoToIntermission(int64_t unk1, char unk2);

0 commit comments

Comments
 (0)