Newbie HvHer
- User ID
- 106229
- Messages
- 44
- Reactions
- 2
- Level
- 9
Dt code:
static void double_tap()
{
static int shot_count{};
static int old_shot_count{ };
double offset_tick{ };
auto temp = active_weapon->GetNextPrimaryAttackTickRatio() + modf(active_weapon->watOffset(), &offset_tick);
auto next_attack = active_weapon->GetNextPrimaryAttackTick();
auto shoot_tick = (int)next_attack + offset_tick;
if (temp >= 0.0) {
if (temp >= 1.0) {
++shoot_tick;
}
}
else {
--shoot_tick;
}
bool f = shot_count % 2;
if (cmd->pb.nAttack1StartHistoryIndex > -1)
shot_count++;
for (int i = 0; i < cmd->pb.input_history.pRep->nAllocatedSize; i++) {
auto input_history = cmd->get_input_entry(i);
if (!input_history) {
continue;
}
input_history->nPlayerTickCount = f ? shoot_tick - 1 : 0;
input_history->flPlayerTickFraction = 0.f;
}
cmd->pb.nAttack1StartHistoryIndex = -1;
old_shot_count = shot_count;
}