int GetPlayerTick() {
float flWatTickOffset{};
float flTemp = SDK::WeaponBase->GetNextPrimaryAttackTickRatio() + modf(SDK::WeaponBase->GetWatTickOffset(), &flWatTickOffset);
int iPlayerTick = flWatTickOffset + SDK::WeaponBase->GetNextPrimaryAttackTick();
if (flTemp >= 1.f)
++iPlayerTick;
else if (flTemp < 0.f)
--iPlayerTick;
return iPlayerTick;
}
void ProcessDoubleTap() {
int iHistoryTick = GetPlayerTick();
if (!C_GET(bool, Vars.bDoubleTap))
return;
if (!SDK::UserCmd->csgoUserCmd.inputHistoryField.pRep)
return;
for (int i = 0; i < SDK::UserCmd->csgoUserCmd.inputHistoryField.pRep->nAllocatedSize; i++) {
CCSGOInputHistoryEntryPB* pInputHistoryEntry = SDK::UserCmd->GetInputHistoryEntry(i);
if (!pInputHistoryEntry)
continue;
pInputHistoryEntry->setPlayerTickCount(iHistoryTick);
pInputHistoryEntry->setPlayerTickFraction(0.f);
}
SDK::UserCmd->csgoUserCmd.nAttack1StartHistoryIndex = -1;
SDK::UserCmd->csgoUserCmd.CheckAndSetBits(CSGOUSERCMD_BITS_ATTACK1START);
}