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 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
27void EliminatedPlayers_Init(float(entity) isEliminated_func)
28{
30 {
31 backtrace("Can't spawn eliminatedPlayers again!");
32 return;
33 }
35 eliminatedPlayers.isEliminated = isEliminated_func;
36}
#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
int Stream
Definition net.qh:234
#define serialize(T, stream,...)
Definition net.qh:243
const int MSG_ENTITY
Definition net.qh:115
#define WriteHeader(to, id)
Definition net.qh:221
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:123
#define backtrace(msg)
Definition log.qh:99
entity nextent(entity e)
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:67