X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fonslaught%2Fcl_controlpoint.qc;h=b8d49b10f2edce3580b517f2556a95f35fd092f7;hb=7e5268799e95d0dd6f2b77ed4e097b0adc755f2b;hp=a03e5b3353f8b6156eac2d8012ff5e0af9d2c96a;hpb=224f6d8084e73e0e643cb2d9d58c466defa9d134;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc index a03e5b335..b8d49b10f 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc @@ -30,7 +30,7 @@ void cpicon_draw(entity this) this.cp_bob_spd = this.cp_bob_spd + 1.875 * frametime; this.colormod = '1 1 1' * (2 - bound(0, (this.pain_finished - time) / 10, 1)); - if(!this.iscaptured) this.alpha = this.health / this.max_health; + if(!this.iscaptured) this.alpha = GetResourceAmount(this, RESOURCE_HEALTH) / this.max_health; if(this.iscaptured) { @@ -165,14 +165,14 @@ NET_HANDLE(ENT_CLIENT_CONTROLPOINT_ICON, bool isnew) this.origin = ReadVector(); setorigin(this, this.origin); - this.health = ReadByte(); + SetResourceAmountExplicit(this, RESOURCE_HEALTH, ReadByte()); this.max_health = ReadByte(); this.count = ReadByte(); this.team = ReadByte(); this.iscaptured = ReadByte(); if(!this.count) - this.count = (this.health - this.max_health) * frametime; + this.count = (GetResourceAmount(this, RESOURCE_HEALTH) - this.max_health) * frametime; cpicon_changeteam(this); cpicon_construct(this, isnew); @@ -189,9 +189,9 @@ NET_HANDLE(ENT_CLIENT_CONTROLPOINT_ICON, bool isnew) _tmp = ReadByte(); - if(_tmp != this.health) + if(_tmp != GetResourceAmount(this, RESOURCE_HEALTH)) cpicon_damage(this, _tmp); - this.health = _tmp; + SetResourceAmountExplicit(this, RESOURCE_HEALTH, _tmp); } }