summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2009-10-23 05:35:09 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:02 +0000
commit306bc987f00dfe804f433ea1e75ee58bc8214feb (patch)
tree85e5ad78ec2c59c2537d4c9a2f62fdec5396c3b0 /src/game/g_main.c
parent412a7cc8ea6198ce71df2ee755a9f42cd7c1e5b2 (diff)
* Prevent new votes from preventing previous votes from executing
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 3c676de1..52ff8a2a 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -2074,12 +2074,23 @@ FUNCTIONS CALLED EVERY FRAME
*/
+void G_ExecuteVote( team_t team )
+{
+ level.voteExecuteTime[ team ] = 0;
+
+ trap_SendConsoleCommand( EXEC_APPEND, va( "%s\n",
+ level.voteString[ team ] ) );
+
+ if( !Q_stricmpn( level.voteString[ team ], "map", 3 ) )
+ level.restarted = qtrue;
+}
+
/*
==================
-CheckVote
+G_CheckVote
==================
*/
-void CheckVote( team_t team )
+void G_CheckVote( team_t team )
{
float votePassThreshold = (float)level.voteThreshold[ team ] / 100.0f;
qboolean pass = qfalse;
@@ -2090,15 +2101,7 @@ void CheckVote( team_t team )
if( level.voteExecuteTime[ team ] &&
level.voteExecuteTime[ team ] < level.time )
{
- level.voteExecuteTime[ team ] = 0;
-
- trap_SendConsoleCommand( EXEC_APPEND,
- va( "%s\n", level.voteString[ team ] ) );
- if( !Q_stricmp( level.voteString[ team ], "map_restart" ) ||
- !Q_stricmpn( level.voteString[ team ], "map", 3 ) )
- {
- level.restarted = qtrue;
- }
+ G_ExecuteVote( team );
}
if( !level.voteTime[ team ] )
@@ -2391,9 +2394,8 @@ void G_RunFrame( int levelTime )
CheckTeamStatus( );
// cancel vote if timed out
- CheckVote( TEAM_NONE );
- CheckVote( TEAM_ALIENS );
- CheckVote( TEAM_HUMANS );
+ for( i = 0; i < NUM_TEAMS; i++ )
+ G_CheckVote( i );
level.frameMsec = trap_Milliseconds();
}