e.ping_packetloss = 0;
e.ping_movementloss = 0;
//e.gotscores = 0; // we might already have the scores...
- SetTeam(e, entcs_GetTeam(i)); // will not hurt; later updates come with HUD_UpdatePlayerTeams
+ int t = entcs_GetScoreTeam(i);
+ if (t) SetTeam(e, t); // will not hurt; later updates come with HUD_UpdatePlayerTeams
RegisterPlayer(e);
HUD_UpdatePlayerPos(e);
}
for(pl = players.sort_next; pl; pl = pl.sort_next)
{
num += 1;
- Team = entcs_GetTeam(pl.sv_entnum);
+ Team = entcs_GetScoreTeam(pl.sv_entnum);
if(SetTeam(pl, Team))
{
tmp = pl.sort_prev;
return entcs_IsSpectating(i) ? NUM_SPECTATOR : entcs_GetTeamColor(i);
}
+ /**
+ * Same as `entcs_GetTeam`, but returns -1 for no team
+ */
+ int entcs_GetScoreTeam(int i)
+ {
+ int t = entcs_GetTeam(i);
+ if (!t) t = -1;
+ return t;
+ }
+
/**
* @param i zero indexed player
*/