]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Update physics stats on connect (fixes sometimes spawning inside the floor)
authorMario <mario@smbclan.net>
Tue, 11 Oct 2016 07:50:30 +0000 (17:50 +1000)
committerMario <mario@smbclan.net>
Tue, 11 Oct 2016 07:50:30 +0000 (17:50 +1000)
qcsrc/common/physics/player.qh
qcsrc/server/client.qc

index 9f540148deb9b8c08908376e644c4c5e93a862a0..1899b1f60f8d79b3c700f201a660e11fcd219989 100644 (file)
@@ -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);
 
index f9b06bdad7f1b4e1b81390a1ba7ea6d49da477e5..ad7b4e8fbc6f751e973b1a917c978ff2c1d7bd46 100644 (file)
@@ -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);
        });