X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fonslaught%2Fsv_controlpoint.qc;h=0941833de8acd7430cc7fb35cef56c104bf405bf;hb=275cead32998c415fff49383920c26e21de48662;hp=4924287189f1809001f2d445f9c30acaab5505da;hpb=43eba8ca70f00458db385630f86009f6d7fa849a;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc index 492428718..0941833de 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc @@ -5,36 +5,38 @@ bool cpicon_send(entity this, entity to, int sf) { WriteHeader(MSG_ENTITY, ENT_CLIENT_CONTROLPOINT_ICON); + if(sf & CPSF_SETUP) + sf &= ~CPSF_STATUS; WriteByte(MSG_ENTITY, sf); if(sf & CPSF_SETUP) { - WriteCoord(MSG_ENTITY, self.origin_x); - WriteCoord(MSG_ENTITY, self.origin_y); - WriteCoord(MSG_ENTITY, self.origin_z); + WriteCoord(MSG_ENTITY, this.origin_x); + WriteCoord(MSG_ENTITY, this.origin_y); + WriteCoord(MSG_ENTITY, this.origin_z); - WriteByte(MSG_ENTITY, self.health); - WriteByte(MSG_ENTITY, self.max_health); - WriteByte(MSG_ENTITY, self.count); - WriteByte(MSG_ENTITY, self.team); - WriteByte(MSG_ENTITY, self.owner.iscaptured); + WriteByte(MSG_ENTITY, this.health); + WriteByte(MSG_ENTITY, this.max_health); + WriteByte(MSG_ENTITY, this.count); + WriteByte(MSG_ENTITY, this.team); + WriteByte(MSG_ENTITY, this.owner.iscaptured); } if(sf & CPSF_STATUS) { - WriteByte(MSG_ENTITY, self.team); + WriteByte(MSG_ENTITY, this.team); - if(self.health <= 0) + if(this.health <= 0) WriteByte(MSG_ENTITY, 0); else - WriteByte(MSG_ENTITY, ceil((self.health / self.max_health) * 255)); + WriteByte(MSG_ENTITY, ceil((this.health / this.max_health) * 255)); } return true; } -void onslaught_controlpoint_icon_link(entity e, void() spawnproc) +void onslaught_controlpoint_icon_link(entity e, void(entity this) spawnproc) { Net_LinkEntity(e, true, 0, cpicon_send); - e.think = spawnproc; + setthink(e, spawnproc); e.nextthink = time * sys_frametime; }