From d4afeac5a575c3c865ea8d592dd85d248a79185d Mon Sep 17 00:00:00 2001 From: Christopher Schwarz Date: Tue, 5 Jul 2011 23:57:24 +0000 Subject: * Fix broken vote display strings, when reasons are used, broken in the ioq3 merge. If other things use Com_Sprintf with a string inside itself, they are probably broken too, so be on the lookout --- src/game/g_cmds.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 046622a7..6a67c1db 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -1292,9 +1292,8 @@ void Cmd_CallVote_f( gentity_t *ent ) sizeof( level.voteDisplayString[ team ] ), "Kick player '%s'", name ); if( reason[ 0 ] ) { - Com_sprintf( level.voteDisplayString[ team ], - sizeof( level.voteDisplayString[ team ] ), "%s for '%s'", - level.voteDisplayString[ team ], reason ); + Q_strcat( level.voteDisplayString[ team ], + sizeof( level.voteDisplayString[ team ] ), va( " for '%s'", reason ) ); } } else if( team == TEAM_NONE ) @@ -1315,9 +1314,8 @@ void Cmd_CallVote_f( gentity_t *ent ) "Mute player '%s'", name ); if( reason[ 0 ] ) { - Com_sprintf( level.voteDisplayString[ team ], - sizeof( level.voteDisplayString[ team ] ), "%s for '%s'", - level.voteDisplayString[ team ], reason ); + Q_strcat( level.voteDisplayString[ team ], + sizeof( level.voteDisplayString[ team ] ), va( " for '%s'", reason ) ); } } else if( !Q_stricmp( vote, "unmute" ) ) @@ -1441,9 +1439,8 @@ void Cmd_CallVote_f( gentity_t *ent ) "Take away building rights from '%s'", name ); if( reason[ 0 ] ) { - Com_sprintf( level.voteDisplayString[ team ], - sizeof( level.voteDisplayString[ team ] ), "%s for '%s'", - level.voteDisplayString[ team ], reason ); + Q_strcat( level.voteDisplayString[ team ], + sizeof( level.voteDisplayString[ team ] ), va( " for '%s'", reason ) ); } } else if( !Q_stricmp( vote, "allowbuild" ) ) -- cgit