From: terencehill Date: Fri, 19 Jun 2020 12:01:12 +0000 (+0200) Subject: Don't call setorigin if the origin hasn't changed X-Git-Tag: xonotic-v0.8.5~908 X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=8afd739673301e42c768d757859ee977fd18fccc Don't call setorigin if the origin hasn't changed --- diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc index 87633056de..8d219c5444 100644 --- a/qcsrc/client/shownames.qc +++ b/qcsrc/client/shownames.qc @@ -213,7 +213,7 @@ void Draw_ShowNames_All() it.sameteam = false; } bool dead = entcs_IsDead(i) || entcs_IsSpectating(i); - if (!it.csqcmodel_isdead || it.alpha > 0) + if ((!it.csqcmodel_isdead || it.alpha > 0) && entcs.origin != it.origin) setorigin(it, entcs.origin); it.csqcmodel_isdead = dead; Draw_ShowNames(it); diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index d85b16b0e7..4c2b5ff269 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -1166,7 +1166,8 @@ void Monster_Frozen_Think(entity this) { STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) + this.ticrate * this.revive_speed, 1); SetResourceExplicit(this, RES_HEALTH, max(1, STAT(REVIVE_PROGRESS, this) * this.max_health)); - this.iceblock.alpha = bound(0.2, 1 - STAT(REVIVE_PROGRESS, this), 1); + if (this.iceblock) + this.iceblock.alpha = bound(0.2, 1 - STAT(REVIVE_PROGRESS, this), 1); if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite) WaypointSprite_UpdateHealth(this.sprite, GetResource(this, RES_HEALTH)); diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index fe2952711f..ea2a62977a 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -2474,7 +2474,8 @@ void PlayerPreThink (entity this) { STAT(REVIVE_PROGRESS, this) = bound(0, STAT(REVIVE_PROGRESS, this) + frametime * this.revive_speed, 1); SetResourceExplicit(this, RES_HEALTH, max(1, STAT(REVIVE_PROGRESS, this) * start_health)); - this.iceblock.alpha = bound(0.2, 1 - STAT(REVIVE_PROGRESS, this), 1); + if (this.iceblock) + this.iceblock.alpha = bound(0.2, 1 - STAT(REVIVE_PROGRESS, this), 1); if (STAT(REVIVE_PROGRESS, this) >= 1) Unfreeze(this, false); diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index e5363db773..48aa78bcfb 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -468,7 +468,9 @@ void Ice_Think(entity this) delete(this); return; } - setorigin(this, this.owner.origin - '0 0 16'); + vector ice_org = this.owner.origin - '0 0 16'; + if (this.origin != ice_org) + setorigin(this, ice_org); this.nextthink = time; } @@ -494,6 +496,7 @@ void Freeze(entity targ, float revivespeed, int frozen_type, bool show_waypoint) entity ice = new(ice); ice.owner = targ; ice.scale = targ.scale; + // set_movetype(ice, MOVETYPE_FOLLOW) would rotate the ice model with the player setthink(ice, Ice_Think); ice.nextthink = time; ice.frame = floor(random() * 21); // ice model has 20 different looking frames