warmup_stage = (nags & 16);
}
+void Ent_EliminatedPlayers()
+{
+ float sf, i, j, b, f;
+
+ sf = ReadByte();
+ if(sf & 1)
+ {
+ for(j = 0; j < maxclients; ++j)
+ if(playerslots[j])
+ playerslots[j].eliminated = 1;
+ for(i = 1; i <= maxclients; i += 8)
+ {
+ f = ReadByte();
+ for(j = i-1, b = 1; b < 256; b *= 2, ++j)
+ if (!(f & b))
+ if(playerslots[j])
+ playerslots[j].eliminated = 0;
+ }
+ }
+}
+
void Ent_RandomSeed()
{
float s;
case ENT_CLIENT_RAINSNOW: Ent_RainOrSnow(); break;
case ENT_CLIENT_LASER: Ent_Laser(); break;
case ENT_CLIENT_NAGGER: Ent_Nagger(); break;
+ case ENT_CLIENT_ELIMINATEDPLAYERS: Ent_EliminatedPlayers(); break;
case ENT_CLIENT_WAYPOINT: Ent_WaypointSprite(); break;
case ENT_CLIENT_RADARLINK: Ent_RadarLink(); break;
case ENT_CLIENT_PROJECTILE: Ent_Projectile(); break;
const float ENT_CLIENT_SPAWNPOINT = 36;
const float ENT_CLIENT_SPAWNEVENT = 37;
const float ENT_CLIENT_NOTIFICATION = 38;
-
+const float ENT_CLIENT_ELIMINATEDPLAYERS = 39;
const float ENT_CLIENT_TURRET = 40;
const float ENT_CLIENT_AUXILIARYXHAIR = 50;
const float ENT_CLIENT_VEHICLE = 60;
return 0;
}
+float EliminatedPlayers_SendEntity(entity to, float sendflags)
+{
+ float i, f, b;
+ entity e;
+ WriteByte(MSG_ENTITY, ENT_CLIENT_ELIMINATEDPLAYERS);
+ WriteByte(MSG_ENTITY, sendflags);
+
+ if(sendflags & 1)
+ {
+ for(i = 1; i <= maxclients; i += 8)
+ {
+ for(f = 0, e = edict_num(i), b = 1; b < 256; b *= 2, e = nextent(e))
+ {
+ if(e.caplayer == 0.5 || (e.caplayer == 1 && (e.deadflag != DEAD_NO || e.frags == FRAGS_LMS_LOSER)))
+ f |= b;
+ }
+ WriteByte(MSG_ENTITY, f);
+ }
+ }
+
+ return TRUE;
+}
+
+void EliminatedPlayers_Init()
+{
+ Net_LinkEntity(eliminatedPlayers = spawn(), FALSE, 0, EliminatedPlayers_SendEntity);
+}
+
+
MUTATOR_HOOKFUNCTION(ca_PlayerSpawn)
{
self.caplayer = 1;
+ if(!warmup_stage)
+ eliminatedPlayers.SendFlags |= 1;
return 1;
}
ca_LastPlayerForTeam_Notify();
if(!allowed_to_spawn)
self.respawn_flags = RESPAWN_SILENT;
+ if(!warmup_stage)
+ eliminatedPlayers.SendFlags |= 1;
return 1;
}
self.caplayer = 0;
if(self.caplayer)
self.frags = FRAGS_LMS_LOSER;
+ if(!warmup_stage)
+ eliminatedPlayers.SendFlags |= 1;
return 1;
}
addstat(STAT_BLUEALIVE, AS_INT, bluealive_stat);
addstat(STAT_YELLOWALIVE, AS_INT, yellowalive_stat);
addstat(STAT_PINKALIVE, AS_INT, pinkalive_stat);
+
+ EliminatedPlayers_Init();
}
MUTATOR_DEFINITION(gamemode_ca)