From: Mario Date: Sun, 16 Jul 2017 23:00:30 +0000 (+1000) Subject: Only run frozen frame on players (surprised this didn't cause any issues before) X-Git-Tag: xonotic-v0.8.5~2584 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5217b5bde4b9dc4461723adcc1bd78f84d872a42;p=xonotic%2Fxonotic-data.pk3dir.git Only run frozen frame on players (surprised this didn't cause any issues before) --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 70b0455f2..5e4fa38a7 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2501,29 +2501,32 @@ void PlayerPreThink (entity this) this.max_armorvalue = 0; } - if (STAT(FROZEN, this) == 2) - { - this.revive_progress = bound(0, this.revive_progress + frametime * this.revive_speed, 1); - this.health = max(1, this.revive_progress * start_health); - this.iceblock.alpha = bound(0.2, 1 - this.revive_progress, 1); - - if (this.revive_progress >= 1) - Unfreeze(this); - } - else if (STAT(FROZEN, this) == 3) + if(IS_PLAYER(this)) { - this.revive_progress = bound(0, this.revive_progress - frametime * this.revive_speed, 1); - this.health = max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * this.revive_progress ); + if (STAT(FROZEN, this) == 2) + { + this.revive_progress = bound(0, this.revive_progress + frametime * this.revive_speed, 1); + this.health = max(1, this.revive_progress * start_health); + this.iceblock.alpha = bound(0.2, 1 - this.revive_progress, 1); - if (this.health < 1) + if (this.revive_progress >= 1) + Unfreeze(this); + } + else if (STAT(FROZEN, this) == 3) { - if (this.vehicle) - vehicles_exit(this.vehicle, VHEF_RELEASE); - if(this.event_damage) - this.event_damage(this, this, this.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, this.origin, '0 0 0'); + this.revive_progress = bound(0, this.revive_progress - frametime * this.revive_speed, 1); + this.health = max(0, autocvar_g_nades_ice_health + (start_health-autocvar_g_nades_ice_health) * this.revive_progress ); + + if (this.health < 1) + { + if (this.vehicle) + vehicles_exit(this.vehicle, VHEF_RELEASE); + if(this.event_damage) + this.event_damage(this, this, this.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, this.origin, '0 0 0'); + } + else if (this.revive_progress <= 0) + Unfreeze(this); } - else if (this.revive_progress <= 0) - Unfreeze(this); } MUTATOR_CALLHOOK(PlayerPreThink, this);