]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Check frametime before executing code that does nothing if frametime is 0
authorterencehill <piuntn@gmail.com>
Wed, 1 Jan 2020 21:46:07 +0000 (22:46 +0100)
committerterencehill <piuntn@gmail.com>
Wed, 1 Jan 2020 21:46:07 +0000 (22:46 +0100)
qcsrc/server/client.qc

index 3b74ae30320479e52091c762ef8591dacccbae85..175885dbe6514fe4c78817919dbf38d2d4665753 100644 (file)
@@ -2207,8 +2207,6 @@ bool PlayerThink(entity this)
                this.items |= this.items_added;
        }
 
-       player_regen(this);
-
        // WEAPONTODO: Add a weapon request for this
        // rot vortex charge to the charge limit
        for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
@@ -2218,16 +2216,16 @@ bool PlayerThink(entity this)
                        this.(weaponentity).vortex_charge = bound(WEP_CVAR(vortex, charge_limit), this.(weaponentity).vortex_charge - WEP_CVAR(vortex, charge_rot_rate) * frametime / W_TICSPERFRAME, 1);
        }
 
-       if (frametime) player_anim(this);
+       if (frametime)
+       {
+               player_regen(this);
+               player_anim(this);
+               this.dmg_team = max(0, this.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
+       }
 
-       // secret status
        secrets_setstatus(this);
-
-       // monsters status
        monsters_setstatus(this);
 
-       this.dmg_team = max(0, this.dmg_team - autocvar_g_teamdamage_resetspeed * frametime);
-
        return true;
 }
 
@@ -2457,7 +2455,7 @@ void PlayerPreThink (entity this)
                this.max_armorvalue = 0;
        }
 
-       if(IS_PLAYER(this))
+       if (frametime && IS_PLAYER(this))
        {
                if (STAT(FROZEN, this) == FROZEN_TEMP_REVIVING)
                {