Skip to content

Commit

Permalink
* Fix broken vote display strings, when reasons are used, broken in t…
Browse files Browse the repository at this point in the history
…he ioq3 merge. If other things use Com_Sprintf with a string inside itself, they are probably broken too, so be on the lookout
  • Loading branch information
cschwarz committed Jul 5, 2011
1 parent d3296f6 commit 1f52c6e
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/game/g_cmds.c
Expand Up @@ -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 )
Expand All @@ -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" ) )
Expand Down Expand Up @@ -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" ) )
Expand Down

0 comments on commit 1f52c6e

Please sign in to comment.