Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
elimination.qc
Go to the documentation of this file.
1#include "elimination.qh"
2
4#include <server/utils.qh>
5
6.float(entity) isEliminated;
7bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
8{
9 WriteHeader(MSG_ENTITY, ENT_CLIENT_ELIMINATEDPLAYERS);
10 for (int i = 1; i <= maxclients; i += 8) {
11 int f = 0;
12 entity e = edict_num(i);
13 for (int b = 0; b < 8; ++b, e = nextent(e)) {
14 if (eliminatedPlayers.isEliminated(e)) {
15 f |= BIT(b);
16 }
17 }
19 }
20 return true;
21}
22
23void EliminatedPlayers_Init(float(entity) isEliminated_func)
24{
26 {
27 backtrace("Can't spawn eliminatedPlayers again!");
28 return;
29 }
31 eliminatedPlayers.isEliminated = isEliminated_func;
32}
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float maxclients
bool EliminatedPlayers_SendEntity(entity this, entity to, float sendflags)
Definition elimination.qc:7
void EliminatedPlayers_Init(float(entity) isEliminated_func)
entity eliminatedPlayers
Definition elimination.qh:3
const int MSG_ENTITY
Definition net.qh:156
#define WriteHeader(to, id)
Definition net.qh:265
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:167
#define backtrace(msg)
Definition log.qh:99
entity nextent(entity e)
void WriteByte(float data, float dest, float desto)
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:67