From 729766150f376b3c18dd4a0bc05e17d93cc95865 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 12 Apr 2017 17:14:55 -0500 Subject: [PATCH] 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. --- code/game/g_cmds.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/game/g_cmds.c b/code/game/g_cmds.c index f01df847..29a1ce1d 100644 --- a/code/game/g_cmds.c +++ b/code/game/g_cmds.c @@ -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 ) ); }