示例#1
0
/*
================
SV_TransitionGameState

NERVE - SMF
================
*/
static qboolean SV_TransitionGameState(gamestate_t new_gs, gamestate_t old_gs, int delay)
{
	if (!SV_GameIsSinglePlayer() && !SV_GameIsCoop())
	{
		// we always do a warmup before starting match
		if (old_gs == GS_INTERMISSION && new_gs == GS_PLAYING)
		{
			new_gs = GS_WARMUP;
		}
	}

	// check if its a valid state transition
	if (!SV_CheckTransitionGameState(new_gs, old_gs))
	{
		return qfalse;
	}

	if (new_gs == GS_RESET)
	{
		new_gs = GS_WARMUP;
	}

	Cvar_Set("gamestate", va("%i", new_gs));

	return qtrue;
}
示例#2
0
/*
================
SV_TransitionGameState

NERVE - SMF
================
*/
static qboolean SV_TransitionGameState( gamestate_t new_gs, gamestate_t old_gs, int delay ) {
	// we always do a warmup before starting match
	if ( old_gs == GS_INTERMISSION && new_gs == GS_PLAYING ) {
		new_gs = GS_WARMUP;
	}

	// check if its a valid state transition
	if ( !SV_CheckTransitionGameState( new_gs, old_gs ) ) {
		return qfalse;
	}

	if ( new_gs == GS_RESET ) {
		if ( atoi( Cvar_VariableString( "g_noTeamSwitching" ) ) ) {
			new_gs = GS_WAITING_FOR_PLAYERS;
		} else {
			new_gs = GS_WARMUP;
		}
	}

	Cvar_Set( "gamestate", va( "%i", new_gs ) );

	return qtrue;
}