Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
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.

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
entity eliminatedPlayers
Definition elimination.qh:3
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
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:67

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

Referenced by freezetag_Initialize(), REGISTER_MUTATOR(), and surv_Initialize().

◆ EliminatedPlayers_SendEntity()

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

Definition at line 7 of file elimination.qc.

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}
#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
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
entity nextent(entity e)

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

Referenced by EliminatedPlayers_Init().

◆ float()

float ( entity )

References entity().