mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2025-02-07 16:31:21 +00:00
Make Team Arena win logic handle more game types/blue team
The Team Arena menu uses red team for single player but q3_ui (and mods could) use blue. Also handle all the game types, not just the ones used by Team Arena. Fixes FFA and Team DM.
This commit is contained in:
parent
4506ebd5d7
commit
4227d97958
1 changed files with 11 additions and 3 deletions
|
@ -1145,6 +1145,7 @@ void LogExit( const char *string ) {
|
||||||
gclient_t *cl;
|
gclient_t *cl;
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
qboolean won = qtrue;
|
qboolean won = qtrue;
|
||||||
|
team_t team = TEAM_RED;
|
||||||
#endif
|
#endif
|
||||||
G_LogPrintf( "Exit: %s\n", string );
|
G_LogPrintf( "Exit: %s\n", string );
|
||||||
|
|
||||||
|
@ -1181,7 +1182,10 @@ void LogExit( const char *string ) {
|
||||||
|
|
||||||
G_LogPrintf( "score: %i ping: %i client: %i %s\n", cl->ps.persistant[PERS_SCORE], ping, level.sortedClients[i], cl->pers.netname );
|
G_LogPrintf( "score: %i ping: %i client: %i %s\n", cl->ps.persistant[PERS_SCORE], ping, level.sortedClients[i], cl->pers.netname );
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
if (g_singlePlayer.integer && g_gametype.integer == GT_TOURNAMENT) {
|
if (g_singlePlayer.integer && !(g_entities[cl - level.clients].r.svFlags & SVF_BOT)) {
|
||||||
|
team = cl->sess.sessionTeam;
|
||||||
|
}
|
||||||
|
if (g_singlePlayer.integer && g_gametype.integer < GT_TEAM) {
|
||||||
if (g_entities[cl - level.clients].r.svFlags & SVF_BOT && cl->ps.persistant[PERS_RANK] == 0) {
|
if (g_entities[cl - level.clients].r.svFlags & SVF_BOT && cl->ps.persistant[PERS_RANK] == 0) {
|
||||||
won = qfalse;
|
won = qfalse;
|
||||||
}
|
}
|
||||||
|
@ -1192,8 +1196,12 @@ void LogExit( const char *string ) {
|
||||||
|
|
||||||
#ifdef MISSIONPACK
|
#ifdef MISSIONPACK
|
||||||
if (g_singlePlayer.integer) {
|
if (g_singlePlayer.integer) {
|
||||||
if (g_gametype.integer >= GT_CTF) {
|
if (g_gametype.integer >= GT_TEAM) {
|
||||||
won = level.teamScores[TEAM_RED] > level.teamScores[TEAM_BLUE];
|
if (team == TEAM_BLUE) {
|
||||||
|
won = level.teamScores[TEAM_BLUE] > level.teamScores[TEAM_RED];
|
||||||
|
} else {
|
||||||
|
won = level.teamScores[TEAM_RED] > level.teamScores[TEAM_BLUE];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
trap_SendConsoleCommand( EXEC_APPEND, (won) ? "spWin\n" : "spLose\n" );
|
trap_SendConsoleCommand( EXEC_APPEND, (won) ? "spWin\n" : "spLose\n" );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue