]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't call setorigin if the origin hasn't changed
authorterencehill <piuntn@gmail.com>
Fri, 19 Jun 2020 12:01:12 +0000 (14:01 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 19 Jun 2020 12:01:12 +0000 (14:01 +0200)
qcsrc/client/shownames.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/server/client.qc
qcsrc/server/g_damage.qc

index 87633056de69b7dbb52e5916b6447352fb3acda7..8d219c5444b03ebf9c1e0a3afbaa7ce0a3d5b200 100644 (file)
@@ -213,7 +213,7 @@ void Draw_ShowNames_All()
                        it.sameteam = false;
                }
                bool dead = entcs_IsDead(i) || entcs_IsSpectating(i);
                        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);
                        setorigin(it, entcs.origin);
                it.csqcmodel_isdead = dead;
                Draw_ShowNames(it);
index d85b16b0e7988d92d694e6e7911bc4f489913d4b..4c2b5ff269a601b1ff502f3977f97af5552aa532 100644 (file)
@@ -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));
        {
                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));
 
                if(!(this.spawnflags & MONSTERFLAG_INVINCIBLE) && this.sprite)
                        WaypointSprite_UpdateHealth(this.sprite, GetResource(this, RES_HEALTH));
index fe2952711f9cd8970ad815f6fa7fd091cbe7ee9c..ea2a62977a331981e2d98809bab83a40a35bd2c8 100644 (file)
@@ -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));
                {
                        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);
 
                        if (STAT(REVIVE_PROGRESS, this) >= 1)
                                Unfreeze(this, false);
index e5363db7738fd9a79b5206fbcaa0262110350a49..48aa78bcfba7ee17974aeb71a8f2ebb0c882653a 100644 (file)
@@ -468,7 +468,9 @@ void Ice_Think(entity this)
                delete(this);
                return;
        }
                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;
 }
 
        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;
        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
        setthink(ice, Ice_Think);
        ice.nextthink = time;
        ice.frame = floor(random() * 21); // ice model has 20 different looking frames