[ioquake3] 27/136: Don't start a vote after vote passed for map change
Simon McVittie
smcv at debian.org
Thu Jun 15 09:09:01 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/master
in repository ioquake3.
commit 729766150f376b3c18dd4a0bc05e17d93cc95865
Author: Zack Middleton <zack at cloemail.com>
Date: Wed Apr 12 17:14:55 2017 -0500
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 f01df84..29a1ce1 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 ) );
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git
More information about the Pkg-games-commits
mailing list