projects
/
xonotic
/
xonotic-data.pk3dir.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a197e3d
)
Don't call setorigin if the origin hasn't changed
author
terencehill <piuntn@gmail.com>
Fri, 19 Jun 2020 12:01:12 +0000
(14:01 +0200)
committer
terencehill <piuntn@gmail.com>
Fri, 19 Jun 2020 12:01:12 +0000
(14:01 +0200)
qcsrc/client/shownames.qc
patch
|
blob
|
history
qcsrc/common/monsters/sv_monsters.qc
patch
|
blob
|
history
qcsrc/server/client.qc
patch
|
blob
|
history
qcsrc/server/g_damage.qc
patch
|
blob
|
history
diff --git
a/qcsrc/client/shownames.qc
b/qcsrc/client/shownames.qc
index
8763305
..
8d219c5
100644
(file)
--- 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);
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);
diff --git
a/qcsrc/common/monsters/sv_monsters.qc
b/qcsrc/common/monsters/sv_monsters.qc
index
d85b16b
..
4c2b5ff
100644
(file)
--- 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));
{
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));
diff --git
a/qcsrc/server/client.qc
b/qcsrc/server/client.qc
index
fe29527
..
ea2a629
100644
(file)
--- 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));
{
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);
diff --git
a/qcsrc/server/g_damage.qc
b/qcsrc/server/g_damage.qc
index
e5363db
..
48aa78b
100644
(file)
--- a/
qcsrc/server/g_damage.qc
+++ b/
qcsrc/server/g_damage.qc
@@
-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