-
Автор темы
- #1
The pixelsurf a loop where it predicts the player's movement for a number of ticks specified by the config variable ps_ticks. For each tick, it ducks the player, predicts the movement, and checks if the player is on the ground or a ladder after prediction. If the player's velocity in the z-axis (vertical) decreases and they are not on the ground, the function sets a flag found_ps to true and stores the number of ticks and the buttons state in the predicted_tickamount and saved_buttons variables, respectively. The loop then breaks.
After the loop, if found_ps is true, the function sets the data::should_ps flag to true, ducks the player, and sets the predicted_tickamount variable to one less than its current value. If found_ps is false, the function checks if the player's velocity is -6.25, -6.0, or -3.125, and if so, sets the data::should_ps flag to true and ducks the player. If the player's velocity does not match any of these values, the function restores the player's original forward and side movement and sets the data::should_ps flag to false. Finally, if predicted_tickamount is not -1, the function decrements it by one and restores the player's buttons state.<3
After the loop, if found_ps is true, the function sets the data::should_ps flag to true, ducks the player, and sets the predicted_tickamount variable to one less than its current value. If found_ps is false, the function checks if the player's velocity is -6.25, -6.0, or -3.125, and if so, sets the data::should_ps flag to true and ducks the player. If the player's velocity does not match any of these values, the function restores the player's original forward and side movement and sets the data::should_ps flag to false. Finally, if predicted_tickamount is not -1, the function decrements it by one and restores the player's buttons state.<3