summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/bg_public.h1
-rw-r--r--src/game/g_cmds.c7
-rw-r--r--src/game/g_combat.c4
-rw-r--r--src/game/g_main.c9
-rw-r--r--src/game/g_spawn.c15
5 files changed, 17 insertions, 19 deletions
diff --git a/src/game/bg_public.h b/src/game/bg_public.h
index 8d74c18c..30ac860d 100644
--- a/src/game/bg_public.h
+++ b/src/game/bg_public.h
@@ -547,6 +547,7 @@ typedef enum
MN_A_TEAMLOCKED,
MN_H_TEAMLOCKED,
MN_PLAYERLIMIT,
+ MN_WARMUP,
// cmd stuff
MN_CMD_CHEAT,
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 8fc9a424..ac88b825 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -560,6 +560,13 @@ void Cmd_Team_f( gentity_t *ent )
else if( oldteam == TEAM_HUMANS )
humans--;
+ // disallow joining teams during warmup
+ if( g_doWarmup.integer && ( ( level.warmupTime - level.time ) / 1000 ) > 0 )
+ {
+ G_TriggerMenu( ent - g_entities, MN_WARMUP );
+ return;
+ }
+
trap_Argv( 1, s, sizeof( s ) );
if( !s[ 0 ] )
diff --git a/src/game/g_combat.c b/src/game/g_combat.c
index 2dca0736..7f71066c 100644
--- a/src/game/g_combat.c
+++ b/src/game/g_combat.c
@@ -41,10 +41,6 @@ void AddScore( gentity_t *ent, int score )
if( !ent->client )
return;
- // no scoring during pre-match warmup
- if( level.warmupTime )
- return;
-
// make alien and human scores equivalent
if ( ent->client->pers.teamSelection == TEAM_ALIENS )
{
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 5503b4c4..df13a957 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -173,8 +173,8 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_teamForceBalance, "g_teamForceBalance", "0", CVAR_ARCHIVE },
- { &g_warmup, "g_warmup", "20", CVAR_ARCHIVE, 0, qtrue },
- { &g_doWarmup, "g_doWarmup", "0", 0, 0, qtrue },
+ { &g_warmup, "g_warmup", "10", CVAR_ARCHIVE, 0, qtrue },
+ { &g_doWarmup, "g_doWarmup", "0", CVAR_ARCHIVE, 0, qtrue },
{ &g_logFile, "g_logFile", "games.log", CVAR_ARCHIVE, 0, qfalse },
{ &g_logFileSync, "g_logFileSync", "0", CVAR_ARCHIVE, 0, qfalse },
@@ -448,9 +448,6 @@ void G_RegisterCvars( void )
if( cv->vmCvar )
cv->modificationCount = cv->vmCvar->modificationCount;
}
-
- // check some things
- level.warmupModificationCount = g_warmup.modificationCount;
}
/*
@@ -1972,7 +1969,7 @@ void CheckExitRules( void )
return;
}
- if( g_timelimit.integer && !level.warmupTime )
+ if( g_timelimit.integer )
{
if( level.time - level.startTime >= g_timelimit.integer * 60000 )
{
diff --git a/src/game/g_spawn.c b/src/game/g_spawn.c
index e505a21b..35c29b4e 100644
--- a/src/game/g_spawn.c
+++ b/src/game/g_spawn.c
@@ -662,19 +662,16 @@ void SP_worldspawn( void )
g_entities[ ENTITYNUM_WORLD ].s.number = ENTITYNUM_WORLD;
g_entities[ ENTITYNUM_WORLD ].classname = "worldspawn";
- // see if we want a warmup time
- trap_SetConfigstring( CS_WARMUP, "" );
if( g_restarted.integer )
- {
trap_Cvar_Set( "g_restarted", "0" );
- level.warmupTime = 0;
- }
- else if( g_doWarmup.integer )
+
+ // see if we want a warmup time
+ trap_SetConfigstring( CS_WARMUP, "-1" );
+ if( g_doWarmup.integer )
{
- // Turn it on
- level.warmupTime = -1;
+ level.warmupTime = level.time - level.startTime + ( g_warmup.integer * 1000 );
trap_SetConfigstring( CS_WARMUP, va( "%i", level.warmupTime ) );
- G_LogPrintf( "Warmup:\n" );
+ G_LogPrintf( "Warmup: %i\n", g_warmup.integer );
}
}