Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
ent_cs.qc File Reference
Include dependency graph for ent_cs.qc:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)
#define DEC_FACTOR   10
#define DEC_FACTOR   (360 / 64)
#define ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)
#define ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)
#define ENTCS_PROP_CODED(id, ispublic, checkprop, checkprop_pl, setprop, decfactor, svsend, clreceive)
#define ENTCS_PROP_CODED(id, ispublic, checkprop, checkprop_pl, setprop, decfactor, svsend, clreceive)
#define ENTCS_PROP_RESOURCE(id, ispublic, checkprop, setprop, decfactor, svsend, clreceive)
#define ENTCS_PROP_RESOURCE(id, ispublic, checkprop, setprop, decfactor, svsend, clreceive)
#define ENTCS_SET_MUTABLE_STRING(var, x)
 the engine player name strings are mutable!
#define ENTCS_SET_NORMAL(var, x)

Functions

bool _entcs_send (entity this, entity to, int sf, int chan)
 bool (entity ent, entity player) m_check
void Ent_RemoveEntCS (entity this)
void entcs_attach (entity player)
void entcs_detach (entity player)
void entcs_force_origin (entity player)
 ENTCS_PROP (ORIGIN, false, origin, origin, ENTCS_SET_NORMAL, WriteVector(chan, ent.origin), { ent.has_sv_origin=true;setorigin(ent, ReadVector());}) ENTCS_PROP_CODED(ANGLES
 ENTCS_PROP_RESOURCE (HEALTH, false, RES_HEALTH, ENTCS_SET_NORMAL, DEC_FACTOR, WriteByte(chan, bound(0, GetResource(ent, RES_HEALTH)/DEC_FACTOR, 255)), ent.healthvalue=ReadByte() *DEC_FACTOR) ENTCS_PROP_RESOURCE(ARMOR
bool entcs_send (entity this, entity to, int sf)
void entcs_think (entity this)
void entcs_update_players (entity player)
 NET_HANDLE (CLIENT_ENTCS, bool isNew)
 NET_HANDLE (ENT_CLIENT_ENTCS, bool isNew)
bool ReadEntcs (entity this)
 SetResourceExplicit (ent, RES_ARMOR, ReadByte() *DEC_FACTOR)) ENTCS_PROP(NAME
 STATIC_INIT (ENTCS_PUBLICMASK)
 STATIC_INIT (EntCSProps_renumber)
 STATIC_INIT (EntCSProps_setglobalids)
 strcpy (ent.netname, ReadString())) ENTCS_PROP(MODEL
 void (entity ent) m_receive
 void (entity ent, entity player) m_set
 void (int chan, entity ent) m_send
 WriteByte (chan, bound(0, GetResource(ent, RES_ARMOR)/DEC_FACTOR, 255))
 WriteByte (chan, ent.angles.y/DEC_FACTOR)
 WriteByte (chan, ent.skin)
 WriteString (chan, ent.netname)

Variables

ent angles = v
 angles_y
 DEC_FACTOR
int ENTCS_PROP_ENTNUM_id = 0
int ENTCS_PROP_HEALTH_id = 0
int ENTCS_PROP_ORIGIN_id = 0
 ENTCS_SET_MUTABLE_STRING
 ENTCS_SET_NORMAL
 false
bool m_public
 model
 netname
 RES_ARMOR
 skin
 true
x = 0
y = ReadByte() * DEC_FACTOR
z = 0

Macro Definition Documentation

◆ _ENTCS_PROP

#define _ENTCS_PROP ( id,
ispublic,
checkprop,
checkprop_pl,
setprop,
svsend,
clreceive )
Value:
void id##_set(entity ent, entity player) \
{ \
setprop(ent.(checkprop), player.(checkprop_pl)); \
} \
void id##_send(int chan, entity ent) \
{ \
LAMBDA(svsend) \
} \
REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) \
{ \
this.m_public = ispublic; \
this.m_check = id##_check; \
this.m_set = id##_set; \
this.m_send = id##_send; \
}
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
int m_id
Definition effect.qh:19
bool m_public
Definition ent_cs.qc:45
#define ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)
Definition ent_cs.qc:69
#define new_pure(class)
purely logical entities (not linked to the area grid)
Definition oo.qh:66

Definition at line 52 of file ent_cs.qc.

52#define _ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive) \
53 void id##_set(entity ent, entity player) \
54 { \
55 setprop(ent.(checkprop), player.(checkprop_pl)); \
56 } \
57 void id##_send(int chan, entity ent) \
58 { \
59 LAMBDA(svsend) \
60 } \
61 REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) \
62 { \
63 this.m_public = ispublic; \
64 this.m_check = id##_check; \
65 this.m_set = id##_set; \
66 this.m_send = id##_send; \
67 }

◆ DEC_FACTOR [1/2]

#define DEC_FACTOR   10

Definition at line 150 of file ent_cs.qc.

◆ DEC_FACTOR [2/2]

#define DEC_FACTOR   (360 / 64)

Definition at line 150 of file ent_cs.qc.

Referenced by ENTCS_PROP_RESOURCE(), SetResourceExplicit(), WriteByte(), and WriteByte().

◆ ENTCS_PROP [1/2]

#define ENTCS_PROP ( id,
ispublic,
checkprop,
checkprop_pl,
setprop,
svsend,
clreceive )
Value:
void id##_receive(entity ent) \
{ \
LAMBDA(clreceive) \
} \
REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) \
{ \
this.m_public = ispublic; \
this.m_receive = id##_receive; \
}

Definition at line 69 of file ent_cs.qc.

69#define ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive) \
70 bool id##_check(entity ent, entity player) \
71 { \
72 return (ent.(checkprop) != player.(checkprop_pl)); \
73 } \
74 _ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)

◆ ENTCS_PROP [2/2]

#define ENTCS_PROP ( id,
ispublic,
checkprop,
checkprop_pl,
setprop,
svsend,
clreceive )
Value:
bool id##_check(entity ent, entity player) \
{ \
return (ent.(checkprop) != player.(checkprop_pl)); \
} \
_ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)

Definition at line 69 of file ent_cs.qc.

69#define ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive) \
70 bool id##_check(entity ent, entity player) \
71 { \
72 return (ent.(checkprop) != player.(checkprop_pl)); \
73 } \
74 _ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)

Referenced by ENTCS_PROP(), and WriteByte().

◆ ENTCS_PROP_CODED [1/2]

#define ENTCS_PROP_CODED ( id,
ispublic,
checkprop,
checkprop_pl,
setprop,
decfactor,
svsend,
clreceive )
Value:
ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)

Definition at line 76 of file ent_cs.qc.

76#define ENTCS_PROP_CODED(id, ispublic, checkprop, checkprop_pl, setprop, decfactor, svsend, clreceive) \
77 bool id##_check(entity ent, entity player) \
78 { \
79 return (floor(ent.(checkprop)) / decfactor != floor(player.(checkprop_pl)) / decfactor); \
80 } \
81 _ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)

◆ ENTCS_PROP_CODED [2/2]

#define ENTCS_PROP_CODED ( id,
ispublic,
checkprop,
checkprop_pl,
setprop,
decfactor,
svsend,
clreceive )
Value:
bool id##_check(entity ent, entity player) \
{ \
return (floor(ent.(checkprop)) / decfactor != floor(player.(checkprop_pl)) / decfactor); \
} \
_ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)
float floor(float f)

Definition at line 76 of file ent_cs.qc.

76#define ENTCS_PROP_CODED(id, ispublic, checkprop, checkprop_pl, setprop, decfactor, svsend, clreceive) \
77 bool id##_check(entity ent, entity player) \
78 { \
79 return (floor(ent.(checkprop)) / decfactor != floor(player.(checkprop_pl)) / decfactor); \
80 } \
81 _ENTCS_PROP(id, ispublic, checkprop, checkprop_pl, setprop, svsend, clreceive)

◆ ENTCS_PROP_RESOURCE [1/2]

#define ENTCS_PROP_RESOURCE ( id,
ispublic,
checkprop,
setprop,
decfactor,
svsend,
clreceive )
Value:
void id##_receive(entity ent) \
{ \
LAMBDA(clreceive) \
} \
REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) \
{ \
this.m_public = ispublic; \
this.m_receive = id##_receive; \
}

Definition at line 100 of file ent_cs.qc.

100#define ENTCS_PROP_RESOURCE(id, ispublic, checkprop, setprop, decfactor, svsend, clreceive) \
101 bool id##_check(entity ent, entity player) \
102 { \
103 return (floor(GetResource(ent, checkprop) / decfactor) != floor(GetResource(player, checkprop) / decfactor)); \
104 } \
105 void id##_set(entity ent, entity player) \
106 { \
107 SetResourceExplicit(ent, checkprop, GetResource(player, checkprop)); \
108 } \
109 void id##_send(int chan, entity ent) \
110 { \
111 LAMBDA(svsend) \
112 } \
113 REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) \
114 { \
115 this.m_public = ispublic; \
116 this.m_check = id##_check; \
117 this.m_set = id##_set; \
118 this.m_send = id##_send; \
119 }

◆ ENTCS_PROP_RESOURCE [2/2]

#define ENTCS_PROP_RESOURCE ( id,
ispublic,
checkprop,
setprop,
decfactor,
svsend,
clreceive )
Value:
bool id##_check(entity ent, entity player) \
{ \
return (floor(GetResource(ent, checkprop) / decfactor) != floor(GetResource(player, checkprop) / decfactor)); \
} \
void id##_set(entity ent, entity player) \
{ \
SetResourceExplicit(ent, checkprop, GetResource(player, checkprop)); \
} \
void id##_send(int chan, entity ent) \
{ \
LAMBDA(svsend) \
} \
REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) \
{ \
this.m_public = ispublic; \
this.m_check = id##_check; \
this.m_set = id##_set; \
this.m_send = id##_send; \
}
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
entity() spawn

Definition at line 100 of file ent_cs.qc.

100#define ENTCS_PROP_RESOURCE(id, ispublic, checkprop, setprop, decfactor, svsend, clreceive) \
101 bool id##_check(entity ent, entity player) \
102 { \
103 return (floor(GetResource(ent, checkprop) / decfactor) != floor(GetResource(player, checkprop) / decfactor)); \
104 } \
105 void id##_set(entity ent, entity player) \
106 { \
107 SetResourceExplicit(ent, checkprop, GetResource(player, checkprop)); \
108 } \
109 void id##_send(int chan, entity ent) \
110 { \
111 LAMBDA(svsend) \
112 } \
113 REGISTER(EntCSProps, ENTCS_PROP, id, m_id, new_pure(entcs_prop)) \
114 { \
115 this.m_public = ispublic; \
116 this.m_check = id##_check; \
117 this.m_set = id##_set; \
118 this.m_send = id##_send; \
119 }

◆ ENTCS_SET_MUTABLE_STRING

#define ENTCS_SET_MUTABLE_STRING ( var,
x )
Value:
strcpy(var, x);
v x
Definition ent_cs.qc:146
#define strcpy(this, s)
Definition string.qh:51

the engine player name strings are mutable!

Definition at line 135 of file ent_cs.qc.

◆ ENTCS_SET_NORMAL

#define ENTCS_SET_NORMAL ( var,
x )
Value:
var = x;

Definition at line 133 of file ent_cs.qc.

Referenced by ENTCS_PROP(), ENTCS_PROP_RESOURCE(), and WriteByte().

Function Documentation

◆ _entcs_send()

bool _entcs_send ( entity this,
entity to,
int sf,
int chan )

Definition at line 213 of file ent_cs.qc.

214 {
215 entity player = this.owner;
216 sf |= BIT(ENTCS_PROP_ENTNUM_id); // assume private
217 do
218 {
219 if (IS_PLAYER(player))
220 {
222 || SAME_TEAM(to, player)
223 || !(IS_PLAYER(to) || INGAME(to)))
224 break;
225 }
226 sf &= ENTCS_PUBLICMASK; // no private updates
227 }
228 while (0);
229
230 sf |= this.m_forceupdate;
231 this.m_forceupdate = 0;
232 if (chan == MSG_ENTITY)
233 WriteHeader(chan, ENT_CLIENT_ENTCS);
234 else
235 WriteHeader(chan, CLIENT_ENTCS);
236 WriteByte(chan, etof(player) - 1);
237 WriteShort(chan, sf);
238 FOREACH(EntCSProps, sf & BIT(it.m_id), it.m_send(chan, this));
239 return true;
240 }
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
entity owner
Definition main.qh:87
#define IS_PLAYER(s)
Definition player.qh:242
int ENTCS_PROP_ENTNUM_id
Definition ent_cs.qc:24
WriteByte(chan, ent.angles.y/DEC_FACTOR)
bool radar_showenemies
Definition ent_cs.qh:46
int m_forceupdate
Definition ent_cs.qh:41
#define FOREACH(list, cond, body)
Definition iter.qh:19
const int MSG_ENTITY
Definition net.qh:156
#define WriteHeader(to, id)
Definition net.qh:265
void WriteShort(float data, float dest, float desto)
#define etof(e)
Definition misc.qh:25
#define INGAME(it)
Definition sv_rules.qh:24
#define SAME_TEAM(a, b)
Definition teams.qh:241

References BIT, ENTCS_PROP_ENTNUM_id, entity(), etof, FOREACH, INGAME, IS_PLAYER, m_forceupdate, MSG_ENTITY, owner, radar_showenemies, SAME_TEAM, WriteByte(), WriteHeader, and WriteShort().

Referenced by entcs_attach(), and entcs_send().

◆ bool()

bool ( entity ent,
entity player )

References entity().

◆ Ent_RemoveEntCS()

void Ent_RemoveEntCS ( entity this)

Definition at line 299 of file ent_cs.qc.

300 {
301 int n = this.sv_entnum;
302 entity e = entcs_receiver(n);
304 strfree(e.netname);
305 strfree(e.model);
306 if (e != this)
307 delete(e);
308 }
int sv_entnum
Definition main.qh:186
#define entcs_receiver(...)
Definition ent_cs.qh:61
#define NULL
Definition post.qh:14
#define strfree(this)
Definition string.qh:57

References entcs_receiver, entity(), NULL, strfree, and sv_entnum.

Referenced by NET_HANDLE().

◆ entcs_attach()

void entcs_attach ( entity player)

Definition at line 271 of file ent_cs.qc.

272 {
273 entity e = CS(player).entcs = new_pure(entcs_sender);
274 e.owner = player;
276 e.nextthink = time;
277 Net_LinkEntity(e, false, 0, entcs_send);
278 // NOTE: the following code block has been disabled as a workaround for https://gitlab.com/xonotic/xonotic-data.pk3dir/-/issues/1824
279#if 0
280 if (!IS_REAL_CLIENT(player)) return;
281 FOREACH_CLIENT(true,
282 {
283 assert(CS(it).entcs);
284 _entcs_send(CS(it).entcs, msg_entity = player, BITS(23), MSG_ONE);
285 });
286#endif
287 }
#define BITS(n)
Definition bits.qh:9
float time
bool entcs_send(entity this, entity to, int sf)
Definition ent_cs.qc:242
bool _entcs_send(entity this, entity to, int sf, int chan)
Definition ent_cs.qc:213
void entcs_think(entity this)
Definition ent_cs.qc:247
entity entcs
Definition ent_cs.qh:34
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:167
#define assert(expr,...)
Definition log.qh:8
float MSG_ONE
Definition menudefs.qc:56
entity msg_entity
Definition progsdefs.qc:63
#define setthink(e, f)
ClientState CS(Client this)
Definition state.qh:47
#define IS_REAL_CLIENT(v)
Definition utils.qh:17
#define FOREACH_CLIENT(cond, body)
Definition utils.qh:52

References _entcs_send(), assert, BITS, CS(), entcs, entcs_send(), entcs_think(), entity(), FOREACH_CLIENT, IS_REAL_CLIENT, msg_entity, MSG_ONE, Net_LinkEntity(), new_pure, setthink, and time.

Referenced by ClientState_attach().

◆ entcs_detach()

void entcs_detach ( entity player)

Definition at line 289 of file ent_cs.qc.

290 {
291 if (!CS(player).entcs)
292 return;
293 delete(CS(player).entcs);
294 CS(player).entcs = NULL;
295 }

References CS(), entcs, entity(), and NULL.

Referenced by ClientState_detach().

◆ entcs_force_origin()

void entcs_force_origin ( entity player)

Definition at line 39 of file ent_cs.qc.

40{
41 CS(player).entcs.m_forceupdate = BIT(ENTCS_PROP_ORIGIN_id);
42}
int ENTCS_PROP_ORIGIN_id
Definition ent_cs.qc:25

References BIT, CS(), ENTCS_PROP_ORIGIN_id, and entity().

Referenced by globalsound(), and playersound().

◆ ENTCS_PROP()

ENTCS_PROP ( ORIGIN ,
false ,
origin ,
origin ,
ENTCS_SET_NORMAL ,
WriteVector(chan, ent.origin) ,
{ ent.has_sv_origin=true;setorigin(ent, ReadVector());}  )

◆ ENTCS_PROP_RESOURCE()

ENTCS_PROP_RESOURCE ( HEALTH ,
false ,
RES_HEALTH ,
ENTCS_SET_NORMAL ,
DEC_FACTOR ,
WriteByte(chan, bound(0, GetResource(ent, RES_HEALTH)/DEC_FACTOR, 255)) ,
ent. healthvalue = ReadByte() * DEC_FACTOR )

◆ entcs_send()

bool entcs_send ( entity this,
entity to,
int sf )

Definition at line 242 of file ent_cs.qc.

243 {
244 return _entcs_send(this, to, sf, MSG_ENTITY);
245 }

References _entcs_send(), entity(), and MSG_ENTITY.

Referenced by entcs_attach().

◆ entcs_think()

void entcs_think ( entity this)

Definition at line 247 of file ent_cs.qc.

248 {
249 this.nextthink = time + 0.015625; // TODO: increase this to like 0.125 once the client can do smoothing
250 entity player = this.owner;
251 FOREACH(EntCSProps, it.m_check(this, player),
252 {
253 it.m_set(this, player);
254 this.SendFlags |= BIT(it.m_id);
255 });
256
258 // health is set to special values after the game ends, ignore any change
260
261 // always send origin of players even if they stand still otherwise
262 // if a teammate isn't in my pvs and their health (or view angle or name
263 // etc...) changes then their tag disappears
264 if (IS_PLAYER(this.owner))
266
267 // not needed, origin is just data to be sent
268 //setorigin(this, this.origin); // relink
269 }
float nextthink
int ENTCS_PROP_HEALTH_id
Definition ent_cs.qc:26
bool intermission_running
int SendFlags
Definition net.qh:159

References BIT, ENTCS_PROP_HEALTH_id, ENTCS_PROP_ORIGIN_id, entity(), FOREACH, intermission_running, IS_PLAYER, nextthink, owner, SendFlags, and time.

Referenced by entcs_attach(), and ReadEntcs().

◆ entcs_update_players()

void entcs_update_players ( entity player)

Definition at line 208 of file ent_cs.qc.

209 {
210 FOREACH_CLIENT(it != player && IS_PLAYER(it), CS(it).entcs.SendFlags |= ENTCS_PRIVATEMASK);
211 }

References CS(), entcs, entity(), FOREACH_CLIENT, and IS_PLAYER.

Referenced by MUTATOR_HOOKFUNCTION(), and PutObserverInServer().

◆ NET_HANDLE() [1/2]

NET_HANDLE ( CLIENT_ENTCS ,
bool isNew )

Definition at line 377 of file ent_cs.qc.

378 {
379 return ReadEntcs(NULL);
380 }
bool ReadEntcs(entity this)
Definition ent_cs.qc:331

References NULL, and ReadEntcs().

◆ NET_HANDLE() [2/2]

NET_HANDLE ( ENT_CLIENT_ENTCS ,
bool isNew )

Definition at line 367 of file ent_cs.qc.

368 {
369 if (isNew)
370 {
371 make_pure(this);
372 this.entremove = Ent_RemoveEntCS;
373 }
374 return ReadEntcs(this);
375 }
void Ent_RemoveEntCS(entity this)
Definition ent_cs.qc:299
#define make_pure(e)
direct use is
Definition oo.qh:13

References Ent_RemoveEntCS(), make_pure, and ReadEntcs().

◆ ReadEntcs()

bool ReadEntcs ( entity this)

Definition at line 331 of file ent_cs.qc.

332 {
333 int n = ReadByte();
334 entity e = entcs_receiver(n);
335 if (e == NULL)
336 {
337 if (!this)
338 // initial = temp
339 e = new_pure(ENT_CLIENT_ENTCS);
340 else
341 // initial = linked
342 e = this;
344 entcs_receiver(n, e);
345 }
346 else if (e != this && this)
347 {
348 // upgrade to linked
349 delete(e);
350 e = this;
352 entcs_receiver(n, e);
353 }
354
356 e.sv_entnum = n;
357 int sf = ReadShort();
358 e.has_sv_origin = false;
359 e.m_entcs_private = boolean(sf & BIT(ENTCS_PROP_ENTNUM_id));
360 FOREACH(EntCSProps, sf & BIT(it.m_id), it.m_receive(e));
361 e.iflags |= IFLAG_ORIGIN;
363 getthink(e)(e);
364 return true;
365 }
#define boolean(value)
Definition bool.qh:9
void InterpolateOrigin_Undo(entity this)
snap origin to iorigin2 (actual origin)
void InterpolateOrigin_Note(entity this)
const int IFLAG_ORIGIN
int ReadByte()
#define getthink(e)

References BIT, boolean, ENTCS_PROP_ENTNUM_id, entcs_receiver, entcs_think(), entity(), FOREACH, getthink, IFLAG_ORIGIN, InterpolateOrigin_Note(), InterpolateOrigin_Undo(), new_pure, NULL, ReadByte(), and setthink.

Referenced by NET_HANDLE(), and NET_HANDLE().

◆ SetResourceExplicit()

SetResourceExplicit ( ent ,
RES_ARMOR ,
ReadByte() * DEC_FACTOR )

References DEC_FACTOR, ReadByte(), RES_ARMOR, and SetResourceExplicit().

Referenced by ammo_bullets_init(), ammo_cells_init(), ammo_fuel_init(), ammo_rockets_init(), ammo_shells_init(), ammo_vaporizercells_init(), assault_objective_decrease_use(), assault_objective_reset(), assault_objective_use(), button_fire(), button_reset(), CheatCommand(), CopyBody(), ctf_FlagDamage(), ctf_FlagSetup(), ctf_FlagThink(), ctf_Handle_Drop(), ctf_Handle_Pickup(), ctf_RespawnFlag(), Damage(), door_damage(), door_go_down(), door_rotating_go_down(), Draw_ShowNames_All(), Draw_WaypointSprite(), electro_orb_setup(), Ent_WaypointSprite(), fd_secret_done(), fd_secret_use(), FireGrapplingHook(), FixIntermissionClient(), ft_RemovePlayer(), func_breakable_behave_destroyed(), func_breakable_behave_restore(), func_breakable_setup(), GiveResourceValue(), item_armorbig_init(), item_armormedium_init(), item_armormega_init(), item_armorsmall_init(), item_healthbig_init(), item_healthmedium_init(), item_healthmega_init(), item_healthsmall_init(), LinkDoors(), load_unit_settings(), M_Golem_Attack_Lightning(), M_Mage_Defend_Shield(), M_Spider_Attack_Web(), M_Zombie_Defend_Block(), M_Zombie_Defend_Block_End(), MapVote_Tick(), Monster_Dead_Fade(), Monster_Reset(), Monster_Spawn_Setup(), multi_reset(), multi_wait(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), ons_ControlPoint_Icon_BuildThink(), ons_ControlPoint_Icon_Spawn(), ons_GeneratorReset(), ons_GeneratorSetup(), orb_setup(), Portal_Spawn(), Portal_TeleportPlayer(), powerup_jetpack_init(), powerups_DropItem(), PutObserverInServer(), secret_reset(), SetResourceExplicit(), spawnfunc(), spawnfunc(), SpectateCopy(), turret_construct(), turret_die(), turret_initialize(), turret_projectile(), turret_respawn(), vehicles_projectile(), W_Arc_Attack_Bolt(), W_Devastator_Attack(), W_Electro_Attack_Orb(), W_Electro_Orb_Stick(), W_Fireball_Attack1(), W_Hagar_Attack(), W_Hagar_Attack2(), W_Hagar_Attack2_Load_Release(), W_Hook_Attack2(), W_Hook_Damage(), W_MineLayer_Attack(), W_MineLayer_Stick(), W_Mortar_Attack(), W_Mortar_Attack2(), W_OverkillRocketPropelledChainsaw_Attack(), W_Seeker_Fire_Missile(), W_Seeker_Fire_Tag(), walker_fire_rocket(), and WaypointSprite_UpdateHealth().

◆ STATIC_INIT() [1/3]

STATIC_INIT ( ENTCS_PUBLICMASK )

Definition at line 197 of file ent_cs.qc.

198 {
199 FOREACH(EntCSProps, true,
200 {
201 if (it.m_public)
202 ENTCS_PUBLICMASK |= BIT(it.m_id);
203 else
204 ENTCS_PRIVATEMASK |= BIT(it.m_id);
205 });
206 }

References BIT, and FOREACH.

◆ STATIC_INIT() [2/3]

STATIC_INIT ( EntCSProps_renumber )

Definition at line 18 of file ent_cs.qc.

19{
20 FOREACH(EntCSProps, true, it.m_id = i);
21}

References FOREACH, and STATIC_INIT.

◆ STATIC_INIT() [3/3]

STATIC_INIT ( EntCSProps_setglobalids )

Definition at line 27 of file ent_cs.qc.

28{
29 FOREACH(EntCSProps, true,
30 {
31 if (it.registered_id == "ENTCS_PROP_ENTNUM") ENTCS_PROP_ENTNUM_id = it.m_id;
32 if (it.registered_id == "ENTCS_PROP_ORIGIN") ENTCS_PROP_ORIGIN_id = it.m_id;
33 if (it.registered_id == "ENTCS_PROP_HEALTH") ENTCS_PROP_HEALTH_id = it.m_id;
34 });
35}

References ENTCS_PROP_ENTNUM_id, ENTCS_PROP_HEALTH_id, ENTCS_PROP_ORIGIN_id, and FOREACH.

◆ strcpy()

strcpy ( ent. netname,
ReadString()  )

References ReadString, and strcpy.

◆ void() [1/3]

void ( entity ent)

References entity().

◆ void() [2/3]

void ( entity ent,
entity player )

References entity().

◆ void() [3/3]

void ( int chan,
entity ent )

References entity().

◆ WriteByte() [1/3]

WriteByte ( chan ,
bound(0, GetResource(ent, RES_ARMOR)/DEC_FACTOR, 255)  )

◆ WriteByte() [2/3]

WriteByte ( chan ,
ent.angles.y/ DEC_FACTOR )

References DEC_FACTOR.

Referenced by _entcs_send(), _wepent_send(), accuracy_send(), bd_controller_send(), bd_server_event(), bumble_raygun_send(), bumblebee_gunner_enter(), bumblebee_gunner_exit(), ClientData_Send(), ClientInit_misc(), conveyor_send(), corner_send(), cpicon_send(), CSQCModel_Send(), CSQCProjectile_SendEntity(), CSQCVehicleSetup(), ctf_FakeTimeLimit(), Damage_DamageInfo_SendEntity(), debug_send(), door_send(), electro_orb_send(), EliminatedPlayers_SendEntity(), FixIntermissionClient(), func_ladder_send(), g_clientmodel_genericsendentity(), GameTypeVote_SendOption(), generator_send(), globalsound(), GrapplingHookSend(), Inventory_Write(), IT_Write(), ItemSend(), laser_SendEntity(), MapVote_SendEntity(), MapVote_SendOption(), MapVote_SendPicture(), MapVote_Tick(), MapVote_WriteMask(), minigame_SendEntity(), modeleffect_SendEntity(), Nagger_SendEntity(), Net_Write_Effect(), Net_Write_Notification(), ons_camSetup(), ons_Link_Send(), orb_send(), PingPLReport_Think(), plat_send(), PlayerScore_SendEntity(), playersound(), pointparticles_SendEntity(), pp_server_event(), PutClientInServer(), PutObserverInServer(), race_ClearTime(), race_ImposePenaltyTime(), race_send_rankings_cnt(), race_send_recordtime(), race_send_speedaward(), race_send_speedaward_alltimebest(), race_SendNextCheckpoint(), race_SendRanking(), race_SendStatus(), race_SendTime(), rainsnow_SendEntity(), ScoreInfo_SendEntity(), Send_WeaponComplain(), SendAuxiliaryXhair(), SendCSQCVaporizerBeamParticle(), SendCSQCVortexBeamParticle(), SendWelcomeMessage(), SetSpectatee_status(), soundtoat(), SpawnCasing(), SpawnEvent_Send(), SpawnPoint_Send(), SpectateSet(), StatusEffects_Write(), stopsoundto(), SurvivalStatuses_SendEntity(), sv_notice_to(), target_music_sendto(), target_push_send(), target_speed_send(), TeamScore_SendEntity(), teleport_dest_send(), train_send(), trigger_common_write(), trigger_impulse_send(), trigger_keylock_send(), trigger_music_SendEntity(), trigger_push_send(), trigger_push_velocity_send(), trigger_teleport_send(), trigger_viewloc_send(), ttt_server_event(), turret_send(), unpause_update(), vehicles_enter(), vehicles_exit(), viewloc_send(), Violence_GibSplash_SendEntity(), void(), W_Arc_Beam_Send(), W_Tuba_NoteSendEntity(), WarpZone_Camera_Send(), WarpZone_Send(), WaypointSprite_SendEntity(), wframe_send(), write_damagetext(), WriteByte(), and WriteByte().

◆ WriteByte() [3/3]

◆ WriteString()

Variable Documentation

◆ angles

ent angles = v

Definition at line 146 of file ent_cs.qc.

Referenced by _Movetype_Physics_ClientFrame(), _Movetype_Physics_Follow(), _Movetype_Physics_Frame(), _Movetype_Physics_Toss(), _Movetype_PushMove(), anticheat_spectatecopy(), bot_think(), buff_Respawn(), bumblebee_exit(), bumblebee_land(), CheatImpulse(), CL_WeaponEntity_SetModel(), clientcamera_send(), CopyBody(), CSQCModel_Effects_Apply(), CSQCPlayer_Physics(), ctf_FlagThink(), door_rotating_init_startopen(), door_rotating_reset(), Draw_ArcBeam(), Draw_GrapplingHook(), dynlight_find_aiment(), electro_orb_draw(), ewheel_draw(), g_clientmodel_genericsendentity(), GrapplingHookThink(), InterpolateOrigin_Do(), InterpolateOrigin_Note(), InterpolateOrigin_Undo(), ItemDraw(), ItemSend(), ka_RespawnBall(), LaunchDebris(), M_Golem_Attack_Smash(), M_Mage_Attack_Spike(), M_Mage_Attack_Teleport(), misc_laser_aim(), ModelEffect_Draw(), modeleffect_SendEntity(), Monster_Dead_Fade(), monster_facing(), Monster_Move(), Monster_Move_2D(), Monster_Reset(), Monster_Spawn(), Monster_WanderTarget(), movelib_groundalign4point(), Movetype_Physics_MatchTicrate(), nade_darkness_boom(), nade_ice_boom(), napalm_ball_think(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), orb_draw(), physical_item_damage(), physical_item_think(), physical_item_touch(), PlayerDamage(), PlayerThink(), PlayerTouchWall(), PM_dodging(), PM_dodging_checkpressedkeys(), Projectile_Draw(), PutObserverInServer(), PutPlayerInServer(), RaceCarPhysics(), racer_align4point(), racer_exit(), racer_think(), raptor_exit(), raptor_land(), relocate_spawnpoint(), SetMovedir(), spawner_use(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), spawnfunc(), SpectateCopy(), spiderbot_blowup(), spiderbot_exit(), StartItem(), SUB_CalcAngleMove(), SUB_CalcAngleMoveDone(), SV_OnEntityPreSpawnFunction(), sys_phys_simulate_simple(), sys_phys_update(), target_push_init(), target_push_send(), target_teleporter_checktarget(), tka_RespawnBall(), trigger_common_write(), turret_construct(), turret_hellion_missile_think(), turret_hk_missile_think(), turret_send(), turret_track(), vehicle_initialize(), vehicles_damage(), vehicles_painframe(), vehicles_spawn(), viewloc_send(), viewmodel_animate(), W_Arc_Bolt_Damage(), W_Arc_Bolt_Touch(), W_Crylink_Touch(), W_Devastator_Damage(), W_Devastator_Think(), W_Hagar_Damage(), W_Hagar_Touch2(), W_MineLayer_Damage(), W_Porto_Touch(), walker_draw(), walker_fire_rocket(), walker_melee_do_dmg(), walker_rocket_loop3(), WarpZone_Teleported_Send(), WarpZone_Think(), WarpZoneCamera_Think(), and WarpZoneLib_ExactTrigger_Init().

◆ angles_y

◆ DEC_FACTOR

DEC_FACTOR

Definition at line 144 of file ent_cs.qc.

◆ ENTCS_PROP_ENTNUM_id

int ENTCS_PROP_ENTNUM_id = 0

Definition at line 24 of file ent_cs.qc.

Referenced by _entcs_send(), ReadEntcs(), and STATIC_INIT().

◆ ENTCS_PROP_HEALTH_id

int ENTCS_PROP_HEALTH_id = 0

Definition at line 26 of file ent_cs.qc.

Referenced by entcs_think(), and STATIC_INIT().

◆ ENTCS_PROP_ORIGIN_id

int ENTCS_PROP_ORIGIN_id = 0

Definition at line 25 of file ent_cs.qc.

Referenced by entcs_force_origin(), entcs_think(), and STATIC_INIT().

◆ ENTCS_SET_MUTABLE_STRING

ENTCS_SET_MUTABLE_STRING

Definition at line 160 of file ent_cs.qc.

◆ ENTCS_SET_NORMAL

ENTCS_SET_NORMAL

Definition at line 144 of file ent_cs.qc.

◆ false

false

Definition at line 144 of file ent_cs.qc.

◆ m_public

bool m_public

Definition at line 45 of file ent_cs.qc.

◆ model

◆ netname

netname

Definition at line 160 of file ent_cs.qc.

◆ RES_ARMOR

◆ skin

ent skin
Initial value:
= ReadByte())
WriteByte(chan, ent.clientcolors),
ent.colormap = ReadByte())
WriteShort(chan, ent.frags),
ent.frags = ReadShort())
WriteByte(chan, ent.handicap_level),
ent.handicap_level = ReadByte())
WriteChar(chan, ent.wants_join),
ent.wants_join = ReadChar())
WriteByte(chan, ent.sv_solid),
ent.sv_solid = ReadByte())
int ENTCS_PUBLICMASK = 0, ENTCS_PRIVATEMASK = 0
float solid
float clientcolors
#define ENTCS_SET_NORMAL(var, x)
Definition ent_cs.qc:133
int frags
Definition ent_cs.qh:67
int wants_join
Definition ent_cs.qh:69
int sv_solid
Definition ent_cs.qh:21
int handicap_level
Definition ent_cs.qh:68
void WriteChar(float data, float dest, float desto)

Definition at line 168 of file ent_cs.qc.

Referenced by Announcer_Countdown(), buff_Init(), buff_Think(), buffs_BuffModel_Think(), CL_ExteriorWeaponentity_Think(), CopyBody(), CSQCPlayer_ModelAppearance_Apply(), CSQCPlayer_ModelAppearance_PostUpdate(), CSQCPlayer_ModelAppearance_PreUpdate(), dom_controlpoint_setup(), dompoint_captured(), dompointtouch(), func_ladder_send(), g_clientmodel_genericsendentity(), ItemSend(), M_Mage_Defend_Heal(), M_Mage_Defend_Heal_Check(), modeleffect_SendEntity(), Monster_Sounds_Update(), Monster_Spawn_Setup(), nade_timer_think(), NET_HANDLE(), player_getspecies(), spawner_use(), StartItem(), UpdatePlayerSounds(), WriteByte(), and XonoticPlayerModelSelector_loadCvars().

◆ true

true

Definition at line 160 of file ent_cs.qc.

◆ x

◆ y

◆ z