Xonotic
elimination.qc
Go to the documentation of this file.
1 #include "elimination.qh"
2 
3 #include <common/net_linked.qh>
4 #include <server/utils.qh>
5 
6 .float(entity) isEliminated;
8 {
9  Stream out = MSG_ENTITY;
10  WriteHeader(out, ENT_CLIENT_ELIMINATEDPLAYERS);
11  serialize(byte, out, sendflags);
12  if (sendflags & 1) {
13  for (int i = 1; i <= maxclients; i += 8) {
14  int f = 0;
15  entity e = edict_num(i);
16  for (int b = 0; b < 8; ++b, e = nextent(e)) {
17  if (eliminatedPlayers.isEliminated(e)) {
18  f |= BIT(b);
19  }
20  }
21  serialize(byte, out, f);
22  }
23  }
24  return true;
25 }
26 
27 void EliminatedPlayers_Init(float(entity) isEliminated_func)
28 {
30  {
31  backtrace("Can't spawn eliminatedPlayers again!");
32  return;
33  }
35  eliminatedPlayers.isEliminated = isEliminated_func;
36 }
int Stream
Definition: net.qh:229
entity() spawn
void EliminatedPlayers_Init(float(entity) isEliminated_func)
Definition: elimination.qc:27
float maxclients
Definition: csprogsdefs.qc:21
entity to
Definition: self.qh:96
bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
Definition: elimination.qc:7
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition: bits.qh:8
#define serialize(T, stream,...)
Definition: net.qh:238
#define backtrace(msg)
Definition: log.qh:105
entity eliminatedPlayers
Definition: elimination.qh:3
#define new_pure(class)
purely logical entities (.origin doesn&#39;t work)
Definition: oo.qh:62
entity int sendflags
Definition: self.qh:96