X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fgamemodes%2Fgamemode%2Fonslaught%2Fsv_generator.qc;h=eb8c13c39cde27fae9779aa8c4e7a8f5e0137427;hb=4b615d6ea3ee6794ea9368c782393c66ef55c170;hp=aeac4e1626d88fa2af7b87cc3bc8611fb59f21cd;hpb=3d4a324cc2e15c1eb99209674942506eb998e2ec;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc index aeac4e162..eb8c13c39 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_generator.qc @@ -6,32 +6,23 @@ bool generator_send(entity this, entity to, int sf) WriteByte(MSG_ENTITY, sf); if(sf & GSF_SETUP) { - WriteCoord(MSG_ENTITY, self.origin_x); - WriteCoord(MSG_ENTITY, self.origin_y); - WriteCoord(MSG_ENTITY, self.origin_z); + WriteVector(MSG_ENTITY, this.origin); - WriteByte(MSG_ENTITY, self.health); - WriteByte(MSG_ENTITY, self.max_health); - WriteByte(MSG_ENTITY, self.count); - WriteByte(MSG_ENTITY, self.team); + WriteByte(MSG_ENTITY, GetResource(this, RES_HEALTH)); + WriteByte(MSG_ENTITY, this.max_health); + WriteByte(MSG_ENTITY, this.count); + WriteByte(MSG_ENTITY, this.team); } if(sf & GSF_STATUS) { - WriteByte(MSG_ENTITY, self.team); + WriteByte(MSG_ENTITY, this.team); - if(self.health <= 0) + if(GetResource(this, RES_HEALTH) <= 0) WriteByte(MSG_ENTITY, 0); else - WriteByte(MSG_ENTITY, ceil((self.health / self.max_health) * 255)); + WriteByte(MSG_ENTITY, ceil((GetResource(this, RES_HEALTH) / this.max_health) * 255)); } return true; } - -void generator_link(void(entity this) spawnproc) -{SELFPARAM(); - Net_LinkEntity(self, true, 0, generator_send); - setthink(self, spawnproc); - self.nextthink = time; -}