summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2009-10-03 12:32:56 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:04 +0000
commitf44fffabb6f7e8dcf701adbd6d379cd4620a7f37 (patch)
treeddc26b28bc9d1a34d620ef161be83eeb19be8a4b /src
parentb606a25e8c414983faf6ffc49c53822f3c07a960 (diff)
* (bug 3964) Fix votedisplaystrings printing as blank in some circumstances (thanks Rezyn for 1/2 of this fix)
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_main.c9
-rw-r--r--src/game/g_main.c5
2 files changed, 14 insertions, 0 deletions
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 1844cdf0..6fe7655d 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -1788,6 +1788,15 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum )
// get the gamestate from the client system
trap_GetGameState( &cgs.gameState );
+ // copy vote display strings so they don't show up blank if we see
+ // the same one directly after connecting
+ Q_strncpyz( cgs.voteString, CG_ConfigString( CS_VOTE_STRING ),
+ sizeof( cgs.voteString ) );
+ Q_strncpyz( cgs.teamVoteString[ 0 ], CG_ConfigString( CS_TEAMVOTE_STRING + 0 ),
+ sizeof( cgs.teamVoteString[ 0 ] ) );
+ Q_strncpyz( cgs.teamVoteString[ 1 ], CG_ConfigString( CS_TEAMVOTE_STRING + 1 ),
+ sizeof( cgs.teamVoteString[ 1 ] ) );
+
// check version
s = CG_ConfigString( CS_GAME_VERSION );
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 88b73c95..16508171 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -670,10 +670,13 @@ static void G_ClearVotes( void )
{
level.voteTime = 0;
trap_SetConfigstring( CS_VOTE_TIME, "" );
+ trap_SetConfigstring( CS_VOTE_STRING, "" );
level.teamVoteTime[ 0 ] = 0;
trap_SetConfigstring( CS_TEAMVOTE_TIME, "" );
+ trap_SetConfigstring( CS_TEAMVOTE_STRING, "" );
level.teamVoteTime[ 1 ] = 0;
trap_SetConfigstring( CS_TEAMVOTE_TIME + 1, "" );
+ trap_SetConfigstring( CS_TEAMVOTE_STRING + 1, "" );
}
/*
@@ -2247,6 +2250,7 @@ void CheckVote( void )
level.voteTime = 0;
trap_SetConfigstring( CS_VOTE_TIME, "" );
+ trap_SetConfigstring( CS_VOTE_STRING, "" );
}
@@ -2295,6 +2299,7 @@ void CheckTeamVote( team_t team )
level.teamVoteTime[ cs_offset ] = 0;
trap_SetConfigstring( CS_TEAMVOTE_TIME + cs_offset, "" );
+ trap_SetConfigstring( CS_TEAMVOTE_STRING + cs_offset, "" );
}