Permalink
Browse files

g_emptyTeamsSkipMapTime

if the teams are empty after this amount of game time, the map is skipped (prevents players joining long-running empty games)
  • Loading branch information...
cu-kai committed Dec 11, 2015
1 parent be1b099 commit ef359dd4fdf45873e4b09566bbf8cf8200c5b3ae
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/sgame/sg_main.cpp
@@ -195,6 +195,7 @@ vmCvar_t g_debugEntities;

vmCvar_t g_instantBuilding;

vmCvar_t g_emptyTeamsSkipMapTime;

// <bot stuff>

@@ -403,6 +404,8 @@ static cvarTable_t gameCvarTable[] =

{ &g_instantBuilding, "g_instantBuilding", "0", 0, 0, true , nullptr },

{ &g_emptyTeamsSkipMapTime, "g_emptyTeamsSkipMapTime", "0", 0, 0, true , nullptr },

// bots: buying
{ &g_bot_buy, "g_bot_buy", "1", CVAR_NORESTART, 0, false, nullptr },
{ &g_bot_rifle, "g_bot_rifle", "1", CVAR_NORESTART, 0, false, nullptr },
@@ -2449,6 +2452,18 @@ void CheckExitRules()
LogExit( "Aliens win." );
G_MapLog_Result( 'a' );
}
else if( g_emptyTeamsSkipMapTime.integer &&
( level.time - level.startTime ) / 60000 >=
g_emptyTeamsSkipMapTime.integer &&
level.team[ TEAM_ALIENS ].numClients == 0 && level.team[ TEAM_HUMANS ].numClients == 0 )
{
//nobody wins because the teams are empty after x amount of game time
level.lastWin = TEAM_NONE;
trap_SendServerCommand( -1, "print \"Empty teams skip map time exceeded.\n\"" );
trap_SetConfigstring( CS_WINNER, "Stalemate" );
LogExit( "Timelimit hit." );
G_MapLog_Result( 't' );
}
}

/*

0 comments on commit ef359dd

Please sign in to comment.