]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/player.qc
Merge branch 'martin-t/warns' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / player.qc
index b62e53e6324a17517387ceed7992308c66291dc4..7d3cab007b508fa6dafceb84a14585d0fd68f327 100644 (file)
@@ -21,7 +21,7 @@ float Physics_ClientOption(entity this, string option, float defaultval)
                if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
                        return cvar(s);
        }
-       if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default)
+       if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default && autocvar_g_physics_clientselect_default != "")
        {
                string s = strcat("g_physics_", autocvar_g_physics_clientselect_default, "_", option);
                if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
@@ -75,6 +75,7 @@ void Physics_UpdateStats(entity this)
        STAT(MOVEVARS_AIRACCELERATE, this) = Physics_ClientOption(this, "airaccelerate", autocvar_sv_airaccelerate);
        STAT(MOVEVARS_AIRSTOPACCELERATE, this) = Physics_ClientOption(this, "airstopaccelerate", autocvar_sv_airstopaccelerate);
        STAT(MOVEVARS_JUMPVELOCITY, this) = Physics_ClientOption(this, "jumpvelocity", autocvar_sv_jumpvelocity);
+       STAT(MOVEVARS_JUMPVELOCITY_CROUCH, this) = Physics_ClientOption(this, "jumpvelocity_crouch", autocvar_sv_jumpvelocity_crouch);
        STAT(MOVEVARS_TRACK_CANJUMP, this) = Physics_ClientOption(this, "track_canjump", autocvar_sv_track_canjump);
 }
 #endif
@@ -303,7 +304,7 @@ bool PlayerJump(entity this)
 #endif
 
        bool doublejump = false;
-       float mjumpheight = PHYS_JUMPVELOCITY(this);
+       float mjumpheight = ((PHYS_JUMPVELOCITY_CROUCH(this) && IS_DUCKED(this)) ? PHYS_JUMPVELOCITY_CROUCH(this) : PHYS_JUMPVELOCITY(this));
        bool track_jump = PHYS_CL_TRACK_CANJUMP(this);
 
        if (MUTATOR_CALLHOOK(PlayerJump, this, mjumpheight, doublejump))
@@ -491,7 +492,7 @@ void SpecialCommand(entity this)
        if(autocvar_sv_cheats || this.maycheat)
        {
                if (!CheatImpulse(this, CHIMPULSE_GIVE_ALL.impulse))
-                       LOG_INFO("A hollow voice says \"Plugh\".\n");
+                       LOG_INFO("A hollow voice says \"Plugh\".");
        }
        else
                STAT(MOVEVARS_SPECIALCOMMAND, this) = true;
@@ -813,7 +814,8 @@ void CSQC_ClientMovement_PlayerMove_Frame(entity this)
 {
 #ifdef SVQC
        // needs to be called before physics are run!
-       PM_UpdateButtons(this, CS(this));
+       if(IS_REAL_CLIENT(this))
+               PM_UpdateButtons(this, CS(this));
 #endif
 
        sys_phys_update(this, PHYS_INPUT_TIMELENGTH);