-
Автор темы
- #1
Сливаю свой десинк статика так как придумал получше
Код:
// velocity min movement
float speed2d = local->get_velocity().length2d();
if (speed2d <= 0.1) // make movement
{
if (bSendPacket) // make micro mov invisible for clients so it should break clientside animations but server gets normal velocity in choked state, so desync appears.
{
cmd->sidemove += command_number % 2 ? -2 : 2;
}
}
if (speed2d <= 0.1 && local->get_duck_ammount() > 0)
{
cmd->sidemove *= 3;
// make our desync on duck maximize because of velocity decrease. cl_showpos for testing.
if (!bSendPacket)
cmd->sidemove = 0; // avoid to move cycle everytime exept of one choked tick, so we should maximaze our desync on this tick.
}
// desync code //
float real = get_real();
cmd->viewangles.y = real;
if (!bSendPacket) // desync angle
{ desync_angle = real + speed2d > 1 ? 120 : 60;
cmd->viewangles.y = desync_angle;
}
if (local->get_animstate()->on_hit_ground && !bSendPacket && was_in_air)
{
cmd->viewangles.y = local->lby() + 36; // make lby broken on landing so we get 108 desync on movement.
was_in_air = false;
}
if (slow_walk) // makes our legs anim gets broken on slow walk
{
if (angle_diff(local->get_animstate()->eye_yaw, local->get_animstate()->goal_feet) < 35 && !bSendPacket)
{
cmd->viewangles.y += 180;
cmd->forwardmove += cmd->forwardmove > 1 ? 1 : - 1;
cmd->sidemove += command_number % 2 ? 0.2 : - 0.2;
}
}