Welcome to hackvshack.net Forum!
Download Free HvH CS2/CS:GO Cheats, CFG, LUA/JS Scripts, and More!
Register

C++ Entity velocity fix

viv.exe

Administrator
User ID:
1097
Messages:
148
Reactions:
212
Badges:
19
REP:
−0/0+
Level:
258
Hey,
You might know that entity velocity is not networked in the game, this means that the netvar for velocity is just calculating it over the last 2 positions of the player.
Maybe you already spotted the issue, what if the velocity is off, while were using it for resolving, prediction or extrapolation? Tough shit.

Lucky for us we can do a very easy fix to increase the accuracy for lots of things when the player suddenly stops moving using layer 6.
C++:
Expand Collapse Copy
 float feetcycle_playback_rate = data.player[entity->index()].networked_layers[6].playbackRate;
        if (feetcycle_playback_rate == 0.f) {
            entity->velocity().x = 0.f;
            entity->velocity().y = 0.f;
        }

This detects by the animation layer if the player is moving at all, if not then we set the velocity on the X and Y axis to 0 so we do not mispredict them.

You could go a step further and get the velocityXY from the animationcode by literally reversing the code.

More info:
 
  • Like
Reactions: trail and Plisskien

Who has read this thread (Total: 0) in last 1 hours View details