Don't start a vote after vote passed for map change

Processing a callvote command after a vote passed to change maps but
has not been executed yet will result in 1) map change immediately
happening 2) after new map loads players have vote HUD messages but
Game VM doesn't have a vote in progress. The phantom vote status will
only be removed if players start a new vote or run vid_restart.

The underlying issue is that a second callvote sets vote config
strings but a map change is executed before they are sent to clients.
Resulting in clients getting "cs" reliable commands with the config
string changes _after_ the map change. Out of sync config strings.

Even if the underlying issue was fixed, the second vote would be lost.
So it's best to not force a map change to happen immediately anyway.

Reported by Tobias Kuehnhammer.
This commit is contained in:
Zack Middleton 2017-04-12 17:14:55 -05:00
parent 300f06ce8d
commit 729766150f
1 changed files with 7 additions and 0 deletions

View File

@ -1312,6 +1312,13 @@ void Cmd_CallVote_f( gentity_t *ent ) {
// if there is still a vote to be executed
if ( level.voteExecuteTime ) {
// don't start a vote when map change or restart is in progress
if ( !Q_stricmpn( level.voteString, "map", 3 )
|| !Q_stricmpn( level.voteString, "nextmap", 7 ) ) {
trap_SendServerCommand( ent-g_entities, "print \"Vote after map change.\n\"" );
return;
}
level.voteExecuteTime = 0;
trap_SendConsoleCommand( EXEC_APPEND, va("%s\n", level.voteString ) );
}