show flag count on HUD (WIP)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6748 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
sireus
2012-01-30 12:54:18 +00:00
parent 5d43fb36bd
commit 4a6b67de1f
3 changed files with 23 additions and 5 deletions
+13 -1
View File
@@ -59,6 +59,18 @@ struct teamscore
}
};
void teamflagscores(int &team1, int &team2)
{
teamscore teamscores[2] = { teamscore(TEAM_CLA), teamscore(TEAM_RVSF) };
loopv(players) if(players[i] && players[i]->team != TEAM_SPECT)
{
teamscores[team_base(players[i]->team)].addplayer(players[i]);
}
if(!watchingdemo) teamscores[team_base(player1->team)].addplayer(player1);
team1 = teamscores[0].flagscore;
team2 = teamscores[1].flagscore;
}
static int teamscorecmp(const teamscore *x, const teamscore *y)
{
if(x->flagscore > y->flagscore) return -1;
@@ -533,4 +545,4 @@ void winners()
result(winners);
}
COMMAND(winners, ARG_NONE);
COMMAND(winners, ARG_NONE);