From: terencehill Date: Wed, 1 Jan 2020 21:46:07 +0000 (+0100) Subject: Check frametime before executing code that does nothing if frametime is 0 X-Git-Tag: xonotic-v0.8.5~1105^2~39^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=158b2b6b0b17350faecb4202525713a9e3635530;p=xonotic%2Fxonotic-data.pk3dir.git Check frametime before executing code that does nothing if frametime is 0 --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 3b74ae303..175885dbe 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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) {