summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/g_cmds.c5
-rw-r--r--src/game/g_local.h1
-rw-r--r--src/game/g_main.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index d31e3821..6b35037c 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1202,6 +1202,7 @@ void Cmd_CallVote_f( gentity_t *ent )
if( level.voteExecuteTime[ team ] )
G_ExecuteVote( team );
+ level.voteDelay[ team ] = 0;
level.voteThreshold[ team ] = 50;
if( g_voteLimit.integer > 0 &&
@@ -1338,6 +1339,7 @@ void Cmd_CallVote_f( gentity_t *ent )
{
strcpy( level.voteString[ team ], vote );
strcpy( level.voteDisplayString[ team ], "Restart current map" );
+ // map_restart comes with a default delay
}
else if( !Q_stricmp( vote, "map" ) )
{
@@ -1354,6 +1356,7 @@ void Cmd_CallVote_f( gentity_t *ent )
Com_sprintf( level.voteDisplayString[ team ],
sizeof( level.voteDisplayString[ team ] ),
"Change to map '%s'", arg );
+ level.voteDelay[ team ] = 3000;
}
else if( !Q_stricmp( vote, "nextmap" ) )
{
@@ -1383,6 +1386,7 @@ void Cmd_CallVote_f( gentity_t *ent )
{
strcpy( level.voteString[ team ], "evacuation" );
strcpy( level.voteDisplayString[ team ], "End match in a draw" );
+ level.voteDelay[ team ] = 3000;
}
else if( !Q_stricmp( vote, "sudden_death" ) )
{
@@ -1462,6 +1466,7 @@ void Cmd_CallVote_f( gentity_t *ent )
Com_sprintf( level.voteString[ team ], sizeof( level.voteString[ team ] ),
"admitdefeat %d", team );
strcpy( level.voteDisplayString[ team ], "Admit Defeat" );
+ level.voteDelay[ team ] = 3000;
}
else
{
diff --git a/src/game/g_local.h b/src/game/g_local.h
index 9132d69e..b3850da9 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -579,6 +579,7 @@ typedef struct
char voteDisplayString[ NUM_TEAMS ][ MAX_STRING_CHARS ];
int voteTime[ NUM_TEAMS ]; // level.time vote was called
int voteExecuteTime[ NUM_TEAMS ]; // time the vote is executed
+ int voteDelay[ NUM_TEAMS ]; // it doesn't make sense to always delay vote execution
int voteYes[ NUM_TEAMS ];
int voteNo[ NUM_TEAMS ];
int numVotingClients[ NUM_TEAMS ];// set by CalculateRanks
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 3f3bf13e..af6cc3b5 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -2178,7 +2178,7 @@ void G_CheckVote( team_t team )
}
if( pass )
- level.voteExecuteTime[ team ] = level.time + 3000;
+ level.voteExecuteTime[ team ] = level.time + level.voteDelay[ team ];
G_LogPrintf( "EndVote: %s %s %d %d %d\n",
team == TEAM_NONE ? "global" : BG_TeamName( team ),