{
TC(bool, is_self); TC(int, pl_number);
string str;
- bool is_spec = entcs_IsSpectating(pl.sv_entnum);
+ bool is_spec = (entcs_GetSpecState(pl.sv_entnum) == ENTCS_SPEC_PURE);
vector h_pos = item_pos;
vector h_size = vec2(panel_size.x, hud_fontsize.y * 1.25);
{ WriteShort(chan, ent.frags); },
{ ent.frags = ReadShort(); })
+ENTCS_PROP(SOLID, true, solid, ENTCS_SET_NORMAL,
+ { WriteByte(chan, ent.solid); },
+ { ent.solid = ReadByte(); })
+
#ifdef SVQC
int ENTCS_PUBLICMASK = 0;
* @param i zero indexed player
*/
.int frags;
- bool entcs_IsSpectating(int i)
+ const int ENTCS_SPEC_PURE = 1; // real spectator
+ const int ENTCS_SPEC_IN_SCOREBOARD = 2; // spectator but still in game (can be in a team)
+ #define entcs_IsSpectating(i) boolean(entcs_GetSpecState(i))
+
+ int entcs_GetSpecState(int i)
{
bool unconnected = !playerslots[i].gotscores;
entity e = entcs_receiver(i);
- return unconnected || ((e) ? e.frags : stof(getplayerkeyvalue(i, "frags"))) == FRAGS_SPECTATOR;
+ int fr = ((e) ? e.frags : stof(getplayerkeyvalue(i, "frags")));
+ if (unconnected || fr == FRAGS_SPECTATOR)
+ return ENTCS_SPEC_PURE;
+ int sol = ((e) ? e.solid : SOLID_NOT);
+ if (fr == FRAGS_PLAYER_OUT_OF_GAME && sol == SOLID_NOT)
+ return ENTCS_SPEC_IN_SCOREBOARD;
+ return 0;
}
/**
/**
* @param i zero indexed player
- * @returns 0 if not teamplay | NUM_TEAM_##N | NUM_SPECTATOR
*/
int entcs_GetTeam(int i)
{
- return entcs_IsSpectating(i) ? NUM_SPECTATOR : entcs_GetTeamColor(i);
+ return (entcs_GetSpecState(i) == ENTCS_SPEC_PURE) ? NUM_SPECTATOR : entcs_GetTeamColor(i);
}
/**