diff options
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r-- | src/game/g_main.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c index 5ab04d94..15a4cb69 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -2044,13 +2044,34 @@ FUNCTIONS CALLED EVERY FRAME void G_ExecuteVote( team_t team ) { + vote_t *v = &level.votes[ team ]; + level.voteExecuteTime[ team ] = 0; - trap_SendConsoleCommand( EXEC_APPEND, va( "%s\n", - level.voteString[ team ] ) ); + switch( v->cons ) + { + case VC_RESTART: + G_PerformMapRestart(); + break; + case VC_MAP: + case VC_NEXTMAP: + { + mapVotePms_t *p = &v->pms.map; + if( v->cons == VC_NEXTMAP ) + { + trap_Cvar_Set( "g_nextMap", p->map ); + trap_Cvar_Update( &g_nextMap ); + } + else + G_PerformMapChange( p->map ); + BG_Free( p->map ); + break; + } + default: + trap_SendConsoleCommand( EXEC_APPEND, va( "%s\n", level.voteString[ team ] ) ); + } - if( !Q_stricmpn( level.voteString[ team ], "map", 3 ) ) - level.restarted = qtrue; + v->cons = VC_OTHER; } /* |