]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/physics/player.qc
Move setting of the slowmo cvar out of the physics function (physics are called multi...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / physics / player.qc
index 84768690c544296b032a5410d79c1cd89707c917..302104351dd19560b004a7e5e14dfb39f6f558c5 100644 (file)
@@ -128,7 +128,17 @@ void PM_ClientMovement_UpdateStatus(entity this, bool ground)
                PM_ClientMovement_Unstick(this);
 
        // set crouched
-       if (PHYS_INPUT_BUTTON_CROUCH(this))
+       bool do_crouch = PHYS_INPUT_BUTTON_CROUCH(this);
+       if(this.hook && !wasfreed(this.hook))
+               do_crouch = false;
+       if(hud != HUD_NORMAL)
+               do_crouch = false;
+       if(STAT(FROZEN, this))
+               do_crouch = false;
+       if((activeweapon == WEP_SHOCKWAVE || activeweapon == WEP_SHOTGUN) && viewmodel.animstate_startframe == viewmodel.anim_fire2_x && time < viewmodel.weapon_nextthink)
+               do_crouch = false;
+
+       if (do_crouch)
        {
                // wants to crouch, this always works
                if (!IS_DUCKED(this)) SET_DUCKED(this);
@@ -586,7 +596,7 @@ void CheckPlayerJump(entity this)
        {
                float air_jump = !PlayerJump(this) || player_multijump; // PlayerJump() has important side effects
                float activate = JETPACK_JUMP(this) && air_jump && PHYS_INPUT_BUTTON_JUMP(this) || PHYS_INPUT_BUTTON_JETPACK(this);
-               float has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO;
+               float has_fuel = !PHYS_JETPACK_FUEL(this) || PHYS_AMMO_FUEL(this) || (ITEMS_STAT(this) & IT_UNLIMITED_WEAPON_AMMO);
 
                if (!(ITEMS_STAT(this) & ITEM_Jetpack.m_itemid)) { }
                else if (this.jetpack_stopped) { }
@@ -1299,11 +1309,6 @@ void PM_Main(entity this)
 
        this.spectatorspeed = STAT(SPECTATORSPEED);
 
-       vector oldv_angle = this.v_angle;
-       vector oldangles = this.angles; // we need to save these, as they're abused by other code
-       this.v_angle = PHYS_INPUT_ANGLES(this);
-       this.angles = PHYS_WORLD_ANGLES(this);
-
        this.team = myteam + 1; // is this correct?
        if (!(PHYS_INPUT_BUTTON_JUMP(this))) // !jump
                UNSET_JUMP_HELD(this); // canjump = true
@@ -1316,7 +1321,7 @@ void PM_Main(entity this)
 
 
 #ifdef SVQC
-       WarpZone_PlayerPhysics_FixVAngle();
+       WarpZone_PlayerPhysics_FixVAngle(this);
 #endif
        float maxspeed_mod = 1;
        maxspeed_mod *= PHYS_HIGHSPEED(this);
@@ -1327,9 +1332,6 @@ void PM_Main(entity this)
        if (this.PlayerPhysplug)
                if (this.PlayerPhysplug(this))
                        return;
-#elif defined(CSQC)
-       if(autocvar_slowmo != STAT(MOVEVARS_TIMESCALE))
-               cvar_set("slowmo", ftos(STAT(MOVEVARS_TIMESCALE)));
 #endif
 
 #ifdef SVQC
@@ -1543,11 +1545,6 @@ LABEL(end)
        this.lastflags = this.flags;
 
        this.lastclassname = this.classname;
-
-#ifdef CSQC
-       this.v_angle = oldv_angle;
-       this.angles = oldangles;
-#endif
 }
 
 #if defined(SVQC)