Xonotic
elimination.qc File Reference
#include "elimination.qh"
#include <common/net_linked.qh>
#include <server/utils.qh>
+ Include dependency graph for elimination.qc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void EliminatedPlayers_Init (float(entity) isEliminated_func)
 
bool EliminatedPlayers_SendEntity (entity this, entity to, float sendflags)
 
 float (entity) isEliminated
 

Function Documentation

◆ EliminatedPlayers_Init()

void EliminatedPlayers_Init ( float(entity isEliminated_func)

Definition at line 27 of file elimination.qc.

References backtrace, eliminatedPlayers, EliminatedPlayers_SendEntity(), and new_pure.

Referenced by freezetag_Initialize(), and REGISTER_MUTATOR().

28 {
30  {
31  backtrace("Can't spawn eliminatedPlayers again!");
32  return;
33  }
35  eliminatedPlayers.isEliminated = isEliminated_func;
36 }
bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
Definition: elimination.qc:7
#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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EliminatedPlayers_SendEntity()

bool EliminatedPlayers_SendEntity ( entity  this,
entity  to,
float  sendflags 
)

Definition at line 7 of file elimination.qc.

References BIT, eliminatedPlayers, entity(), maxclients, nextent(), and serialize.

Referenced by EliminatedPlayers_Init().

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 }
int Stream
Definition: net.qh:229
entity() spawn
float maxclients
Definition: csprogsdefs.qc:21
#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
entity eliminatedPlayers
Definition: elimination.qh:3
entity int sendflags
Definition: self.qh:96
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ float()

float ( entity  )