X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fspawnpoints.qc;h=344f05846f742cdb4d59b2c98ac053be715d1b8d;hp=55662892acdff8160f7a6fefd5d625754b17bdf9;hb=37cf62041a76248472ef6a78feaaed33e35a2260;hpb=678a61b45f332fcd560083b01e6b0bf5a5ae268c diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index 55662892a..344f05846 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -15,9 +15,9 @@ bool SpawnPoint_Send(entity this, entity to, int sf) WriteHeader(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT); WriteByte(MSG_ENTITY, self.team); - WriteShort(MSG_ENTITY, self.origin.x); - WriteShort(MSG_ENTITY, self.origin.y); - WriteShort(MSG_ENTITY, self.origin.z); + WriteCoord(MSG_ENTITY, self.origin.x); + WriteCoord(MSG_ENTITY, self.origin.y); + WriteCoord(MSG_ENTITY, self.origin.z); return true; } @@ -30,13 +30,13 @@ bool SpawnEvent_Send(entity this, entity to, int sf) if(autocvar_g_spawn_alloweffects) { - WriteByte(MSG_ENTITY, etof(self.owner)); - WriteShort(MSG_ENTITY, self.owner.origin.x); - WriteShort(MSG_ENTITY, self.owner.origin.y); - WriteShort(MSG_ENTITY, self.owner.origin.z); + WriteByte(MSG_ENTITY, etof(this.owner)); + WriteCoord(MSG_ENTITY, this.owner.origin.x); + WriteCoord(MSG_ENTITY, this.owner.origin.y); + WriteCoord(MSG_ENTITY, this.owner.origin.z); send = true; } - else if((to == self.owner) || (IS_SPEC(to) && (to.enemy == self.owner)) ) + else if((to == this.owner) || (IS_SPEC(to) && (to.enemy == this.owner)) ) { WriteByte(MSG_ENTITY, 0); send = true; @@ -49,6 +49,7 @@ bool SpawnEvent_Send(entity this, entity to, int sf) .vector spawnpoint_prevorigin; void spawnpoint_think() { + SELFPARAM(); self.nextthink = time + 0.1; if(self.origin != self.spawnpoint_prevorigin) { @@ -214,7 +215,6 @@ vector Spawn_Score(entity spot, float mindist, float teamcheck) {SELFPARAM(); float shortest, thisdist; float prio; - entity player; prio = 0; @@ -239,12 +239,11 @@ vector Spawn_Score(entity spot, float mindist, float teamcheck) } shortest = vlen(world.maxs - world.mins); - FOR_EACH_PLAYER(player) if (player != self) - { - thisdist = vlen(player.origin - spot.origin); + FOREACH_CLIENT(IS_PLAYER(it) && it != self, LAMBDA( + thisdist = vlen(it.origin - spot.origin); if (thisdist < shortest) shortest = thisdist; - } + )); if(shortest > mindist) prio += SPAWN_PRIO_GOOD_DISTANCE;