diff --git a/reaction/game/g_main.c b/reaction/game/g_main.c index 24506ea0..b99cc6f0 100644 --- a/reaction/game/g_main.c +++ b/reaction/game/g_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.28 2002/03/07 14:29:12 slicer +// Intermission ala aq2, when timelimit/roundlimit hits. +// // Revision 1.27 2002/03/07 01:38:36 assimon // Changed Ref System. New cvar added - g_RQ3_RefID. Now referee is peserved even on map changes or map_restarts. // @@ -1379,15 +1382,19 @@ The level will stay at the intermission for a minimum of 5 seconds If all players wish to continue, the level will then exit. If one or more players have not acknowledged the continue, the game will wait 10 seconds before going on. + +Slicer: This is changed for rq3. minimum of 5 secs showing scoreboard +and then, if a player presses BUTTON_ATTACK, change the map + ================= */ void CheckIntermissionExit( void ) { - int ready, notReady; +// int ready, notReady; int i; gclient_t *cl; - int readyMask; +// int readyMask; - if ( g_gametype.integer == GT_SINGLE_PLAYER ) { +/* if ( g_gametype.integer == GT_SINGLE_PLAYER ) { return; } @@ -1423,12 +1430,24 @@ void CheckIntermissionExit( void ) { } cl->ps.stats[STAT_CLIENTS_READY] = readyMask; } - +*/ // never exit in less than five seconds if ( level.time < level.intermissiontime + 5000 ) { return; } + for (i=0 ; i< g_maxclients.integer ; i++) { + cl = level.clients + i; + if ( cl->pers.connected != CON_CONNECTED ) { + continue; + } + if ( g_entities[cl->ps.clientNum].r.svFlags & SVF_BOT ) { + continue; + } + if(g_entities[cl->ps.clientNum].client->buttons & BUTTON_ATTACK) + ExitLevel(); + } +/* // if nobody wants to go, clear timer if ( !ready ) { level.readyToExit = qfalse; @@ -1454,6 +1473,7 @@ void CheckIntermissionExit( void ) { } ExitLevel(); + */ } /* @@ -1485,6 +1505,7 @@ CheckExitRules There will be a delay between the time the exit is qualified for and the time everyone is moved to the intermission spot, so you can see the last frag. + ================= */ void CheckExitRules( void ) { @@ -1496,6 +1517,9 @@ void CheckExitRules( void ) { CheckIntermissionExit (); return; } + //Slicer + if(g_gametype.integer == GT_TEAMPLAY) + return; if ( level.intermissionQueued ) { #ifdef MISSIONPACK @@ -1518,8 +1542,7 @@ void CheckExitRules( void ) { // always wait for sudden death return; } - //Slicer: Matchmode - if ( g_timelimit.integer && !level.warmupTime && !g_RQ3_matchmode.integer) { + if ( g_timelimit.integer && !level.warmupTime) { if ( level.time - level.startTime >= g_timelimit.integer*60000 ) { trap_SendServerCommand( -1, "print \"Timelimit hit.\n\""); LogExit( "Timelimit hit." ); @@ -1576,6 +1599,7 @@ void CheckExitRules( void ) { return; } } + } @@ -2036,9 +2060,10 @@ void G_RunFrame( int levelTime ) { // see if it is time to end the level // JBravo: no need if teamplay - if ( g_gametype.integer != GT_TEAMPLAY ) { + // Slicer: We will need it now for the rotation system.. +// if ( g_gametype.integer != GT_TEAMPLAY ) { CheckExitRules(); - } +// } // update to team status? // JBravo: no need if teamplay diff --git a/reaction/game/g_teamplay.c b/reaction/game/g_teamplay.c index a6ebeceb..708c6b0d 100644 --- a/reaction/game/g_teamplay.c +++ b/reaction/game/g_teamplay.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.30 2002/03/07 14:29:12 slicer +// Intermission ala aq2, when timelimit/roundlimit hits. +// // Revision 1.29 2002/03/05 02:08:16 jbravo // Fixed Unknown client command: Roundlimit bug // @@ -115,6 +118,11 @@ void CheckTeamRules() int checked_tie = 0; gentity_t *player; + //Slicer + if(level.intermissiontime) + return; + + level.fps = trap_Cvar_VariableIntegerValue("sv_fps"); if (level.lights_camera_action) { @@ -186,14 +194,20 @@ void CheckTeamRules() } else { if (level.time - level.startTime >= g_timelimit.integer*60000) { - trap_SendServerCommand( -1, va("cp \"Timelimit hit.\n\"")); + //Slicer : Let's do a normal console print instead.. + trap_SendServerCommand( -1, "print \"Timelimit hit.\n\"" ); + //trap_SendServerCommand( -1, va("cp \"Timelimit hit.\n\"")); level.team_round_going = level.team_round_countdown = level.team_game_going = 0; + //Slicer: Start Intermission + BeginIntermission(); return; } } } if (!level.team_round_countdown) { if (BothTeamsHavePlayers()) { + //Slicer let's print to the console too + trap_SendServerCommand( -1, "print \"The round will begin in 20 seconds!\n\"" ); trap_SendServerCommand( -1, va("cp \"The round will begin in 20 seconds!\n\"")); level.team_round_countdown = (201*level.fps)/10; } @@ -428,6 +442,8 @@ int WonGame(int winner) if(level.time - level.startTime >= g_timelimit.integer*60000) { trap_SendServerCommand( -1, "print \"Timelimit hit.\n\"" ); level.team_round_going = level.team_round_countdown = level.team_game_going = 0; + //Slicer: Start Intermission + BeginIntermission(); return 1; } } @@ -446,8 +462,12 @@ int WonGame(int winner) return 1; } else { + //Slicer: Adding a normal console print.. + trap_SendServerCommand( -1, "print \"Roundlimit hit.\n\"" ); trap_SendServerCommand( -1, va("cp \"Roundlimit hit.\n\"")); level.team_round_going = level.team_round_countdown = level.team_game_going = 0; + //Slicer: Start Intermission + BeginIntermission(); return 1; } }