From 580ce546e205ec9e709101207b03c8f2e66bb373 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 11 Oct 2016 17:50:30 +1000 Subject: [PATCH] Update physics stats on connect (fixes sometimes spawning inside the floor) --- qcsrc/common/physics/player.qh | 2 ++ qcsrc/server/client.qc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/qcsrc/common/physics/player.qh b/qcsrc/common/physics/player.qh index 9f540148d..1899b1f60 100644 --- a/qcsrc/common/physics/player.qh +++ b/qcsrc/common/physics/player.qh @@ -247,6 +247,8 @@ STATIC_INIT(PHYS_INPUT_BUTTON_JETPACK) bool Physics_Valid(string thecvar); + void Physics_UpdateStats(entity this, float maxspd_mod); + .float stat_sv_airspeedlimit_nonqw = _STAT(MOVEVARS_AIRSPEEDLIMIT_NONQW); .float stat_sv_maxspeed = _STAT(MOVEVARS_MAXSPEED); diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index f9b06bdad..ad7b4e8fb 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -1208,6 +1208,9 @@ void ClientConnect(entity this) if (IS_REAL_CLIENT(this)) sv_notice_join(this); + // update physics stats (players can spawn before physics runs) + Physics_UpdateStats(this, PHYS_HIGHSPEED(this)); + IL_EACH(g_initforplayer, it.init_for_player, { it.init_for_player(it, this); }); -- 2.39.2