bool SpawnPoint_Send(entity this, entity to, int sf)
{
- WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
+ WriteHeader(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
WriteByte(MSG_ENTITY, self.team);
WriteShort(MSG_ENTITY, self.origin.x);
{
float send;
- WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNEVENT);
+ WriteHeader(MSG_ENTITY, ENT_CLIENT_SPAWNEVENT);
if(autocvar_g_spawn_alloweffects)
{
- WriteByte(MSG_ENTITY, num_for_edict(self.owner));
+ 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);
{
// show where spawnpoints point at too
makevectors(self.angles);
- entity e;
- e = spawn();
- e.classname = "info_player_foo";
+ entity e = new(info_player_foo);
setorigin(e, self.origin + v_forward * 24);
setsize(e, '-8 -8 -8', '8 8 8');
e.solid = SOLID_TRIGGER;
{SELFPARAM();
float shortest, thisdist;
float prio;
- entity player;
prio = 0;
}
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;