Skip to content

Move some code that only needs to run once per frame out of PlayerP*Think()

bones_was_here requested to merge bones_was_here/sv_playerthink_optimise into master

Most of the code run by PlayerPreThink() and PlayerPostThink() only needs to run once per server frame, but these functions are called for every asynchronous move a client submits (a popular server receives a lot of these per frame) as well as once per server frame.

This adds a function PlayerFrame() for such code, and some comments to help developers implement their features in the most optimal place.
There's plenty more code left that can be moved there, but I'm being conservative here because there's a lot of unrelated features to check for subtle regressions, and moving certain code blocks changes the hash. The changes included here seem to work fine in a variety of gametypes.

Merge request reports