From e57ad61c9df1923d04a6b3d282672e4fb1ce0920 Mon Sep 17 00:00:00 2001 From: Daniel Simoes Date: Sat, 8 Jun 2002 10:51:42 +0000 Subject: [PATCH] Added a better end message for MM matches --- reaction/game/g_matchmode.c | 11 +++++++++++ reaction/game/g_matchmode.h | 1 + reaction/game/g_teamplay.c | 7 +++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/reaction/game/g_matchmode.c b/reaction/game/g_matchmode.c index 0b6e38f1..c2b2b155 100644 --- a/reaction/game/g_matchmode.c +++ b/reaction/game/g_matchmode.c @@ -5,6 +5,17 @@ int ClientNumberFromString(gentity_t *to, char *s); int refVotes[2]; // refVotes[0] is the clientnumber red team voted // refVotes[1] is the clientnumber blue team voted +void SendEndMessage() { + + int mins, secs; + + mins = (int)floor(level.matchTime / 60.0f); + secs = level.matchTime - (mins * 60); + + trap_SendServerCommand( -1, "cp \"Match is Over!\n\""); + trap_SendServerCommand( -1, va("print \"Scores: Team1 [%d] - Team2 [%d] \n\"",level.teamScores[TEAM_RED],level.teamScores[TEAM_BLUE])); + trap_SendServerCommand( -1, va("print \"Total Match Time: %d:%02d \n\"",mins,secs)); +} gentity_t* getEntByName ( char *name ){ gentity_t *ent; int i; diff --git a/reaction/game/g_matchmode.h b/reaction/game/g_matchmode.h index 945aeb62..78e7aab6 100644 --- a/reaction/game/g_matchmode.h +++ b/reaction/game/g_matchmode.h @@ -7,6 +7,7 @@ void MM_ClearScores( void ); void MM_TeamName_f(gentity_t *); void MM_TeamModel_f(gentity_t *); void MM_Referee_f(gentity_t *); +void SendEndMessage(); // aasimon: Declarations for Ref system qboolean Ref_Exists( void ); diff --git a/reaction/game/g_teamplay.c b/reaction/game/g_teamplay.c index cde02cf1..08af5cf5 100644 --- a/reaction/game/g_teamplay.c +++ b/reaction/game/g_teamplay.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.104 2002/06/08 10:51:42 slicer +// Added a better end message for MM matches +// // Revision 1.103 2002/06/07 19:07:08 slicer // removed cvars for teamXready, replaced by level.teamXready // @@ -711,13 +714,13 @@ int WonGame(int winner) //Slicer : Matchmode if (g_RQ3_matchmode.integer) { if (level.matchTime >= g_timelimit.integer * 60) { + SendEndMessage(); level.inGame = level.team_round_going = level.team_round_countdown = level.team_game_going = level.matchTime = 0; trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND)); level.team1ready = qfalse; level.team2ready = qfalse; MakeAllLivePlayersObservers (); - trap_SendServerCommand( -1, "cp \"Match is OVER !!!.\n\""); return 1; } } @@ -737,13 +740,13 @@ int WonGame(int winner) if (level.teamScores[TEAM_RED] >= g_RQ3_roundlimit.integer || level.teamScores[TEAM_BLUE] >= g_RQ3_roundlimit.integer) { //Slicer : Matchmode if (g_RQ3_matchmode.integer) { + SendEndMessage(); level.inGame = level.team_round_going = level.team_round_countdown = level.team_game_going = level.matchTime = 0; trap_SendServerCommand( -1, va("rq3_cmd %i 0", ROUND)); level.team1ready = qfalse; level.team2ready = qfalse; MakeAllLivePlayersObservers (); - trap_SendServerCommand( -1, "cp \"Match is OVER !!!.\n\""); return 1; } else { //Slicer: Adding a normal console print..