From: bones_was_here Date: Sun, 25 Feb 2024 13:27:58 +0000 (+0000) Subject: Merge branch 'bones_was_here/sv_playerthink_optimise' into 'master' X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=31c2c083fdb475eb25db8b18f9624a1739b3f58a;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'bones_was_here/sv_playerthink_optimise' into 'master' Move some code that only needs to run once per frame out of PlayerP*Think() See merge request xonotic/xonotic-data.pk3dir!1238 --- 31c2c083fdb475eb25db8b18f9624a1739b3f58a diff --cc qcsrc/server/main.qc index b5832d893,a290f4032..40e14c906 --- a/qcsrc/server/main.qc +++ b/qcsrc/server/main.qc @@@ -294,11 -288,15 +294,14 @@@ void systems_update() void sys_phys_update(entity this, float dt); void StartFrame() { - // TODO: if move is more than 50ms, split it into two moves (this matches QWSV behavior and the client prediction) - IL_EACH(g_players, IS_FAKE_CLIENT(it), sys_phys_update(it, frametime)); - IL_EACH(g_players, IS_FAKE_CLIENT(it), PlayerPreThink(it)); + FOREACH_CLIENT(IS_FAKE_CLIENT(it), + { + // DP calls these for real clients only + sys_phys_update(it, frametime); // called by SV_PlayerPhysics for players + PlayerPreThink(it); + }); execute_next_frame(); - if (autocvar_sv_autopause && !server_is_dedicated) Pause_TryPause(); delete_fn = remove_unsafely; // not during spawning! serverprevtime = servertime;