WriteHeader(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
WriteByte(MSG_ENTITY, this.team);
- WriteCoord(MSG_ENTITY, this.origin.x);
- WriteCoord(MSG_ENTITY, this.origin.y);
- WriteCoord(MSG_ENTITY, this.origin.z);
+ WriteVector(MSG_ENTITY, this.origin);
return true;
}
if(autocvar_g_spawn_alloweffects)
{
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);
+ WriteVector(MSG_ENTITY, this.owner.origin);
send = true;
}
else if((to == this.owner) || (IS_SPEC(to) && (to.enemy == this.owner)) )
// _y: weight
vector Spawn_Score(entity this, entity spot, float mindist, float teamcheck)
{
- float shortest, thisdist;
- float prio;
-
- prio = 0;
-
// filter out spots for the wrong team
if(teamcheck >= 0)
if(spot.team != teamcheck)
return '-1 0 0';
}
- shortest = vlen(world.maxs - world.mins);
+ float prio = 0;
+ float shortest = vlen(world.maxs - world.mins);
FOREACH_CLIENT(IS_PLAYER(it) && it != this, {
- thisdist = vlen(it.origin - spot.origin);
+ float thisdist = vlen(it.origin - spot.origin);
if (thisdist < shortest)
shortest = thisdist;
});