X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fonslaught%2Fcl_controlpoint.qc;h=2e05794da592540de8ff1794900eb7fa2d370ec3;hp=a03e5b3353f8b6156eac2d8012ff5e0af9d2c96a;hb=8e4957c252f8381e37f2a72e227797bf51e5cc2f;hpb=15a474a8dd9705bfb43f00cbef66f4ab49e76aa8 diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc b/qcsrc/common/gamemodes/gamemode/onslaught/cl_controlpoint.qc index a03e5b335..2e05794da 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 = GetResource(this, RES_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(); + SetResourceExplicit(this, RES_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 = (GetResource(this, RES_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 != GetResource(this, RES_HEALTH)) cpicon_damage(this, _tmp); - this.health = _tmp; + SetResourceExplicit(this, RES_HEALTH, _tmp); } }