From: Mario Date: Tue, 11 Oct 2016 07:50:30 +0000 (+1000) Subject: Update physics stats on connect (fixes sometimes spawning inside the floor) X-Git-Tag: xonotic-v0.8.2~527 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=580ce546e205ec9e709101207b03c8f2e66bb373;p=xonotic%2Fxonotic-data.pk3dir.git Update physics stats on connect (fixes sometimes spawning inside the floor) --- 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); });