#ifdef CSQC
- AL_declare(_entcs);
+ ArrayList _entcs;
STATIC_INIT(_entcs)
{
- AL_init(_entcs, 255, NULL, e); // 255 is the engine limit on maxclients
+ AL_NEW(_entcs, 255, NULL, e); // 255 is the engine limit on maxclients
}
SHUTDOWN(_entcs)
{
- AL_delete(_entcs);
+ AL_DELETE(_entcs);
}
- #define entcs_receiver(...) EVAL(OVERLOAD(entcs_receiver, __VA_ARGS__))
+ #define entcs_receiver(...) EVAL_entcs_receiver(OVERLOAD(entcs_receiver, __VA_ARGS__))
+ #define EVAL_entcs_receiver(...) __VA_ARGS__
#define entcs_receiver_1(i) AL_gete(_entcs, i)
#define entcs_receiver_2(i, v) AL_sete(_entcs, i, v)
#define entcs_is_self(e) ((e).sv_entnum == player_localentnum - 1)
return entcs_IsSpectating(i) ? NUM_SPECTATOR : entcs_GetTeamColor(i);
}
+ /**
+ * Same as `entcs_GetTeam`, but returns -1 for no team in teamplay
+ */
+ int entcs_GetScoreTeam(int i)
+ {
+ int t = entcs_GetTeam(i);
+ if (teamplay && !t) t = -1;
+ return t;
+ }
+
/**
* @param i zero indexed player
*/