summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2010-12-05 04:05:21 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:43 +0000
commit537a0684057830ae9c96c921c2a0237f14c951be (patch)
tree37738e75b561f680d3b3a6b7abd2006491641edc /src
parent38b856f74c691f52182d13831810741cb7e9598f (diff)
* (bug 4268) Disable vote bind instructions when tutorial mode is off
* (bug 4811) Fix colour bleed in vote reasons (Brian "Teapot" Shannon) * Decolour vote caller for consistency with the other vote elements
Diffstat (limited to 'src')
-rw-r--r--src/cgame/cg_draw.c19
-rw-r--r--src/game/g_cmds.c11
2 files changed, 19 insertions, 11 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 848b20d3..24bc2d94 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -3057,7 +3057,7 @@ static void CG_DrawVote( team_t team )
char *s;
int sec;
vec4_t white = { 1.0f, 1.0f, 1.0f, 1.0f };
- char yeskey[ 32 ], nokey[ 32 ];
+ char yeskey[ 32 ] = "", nokey[ 32 ] = "";
if( !cgs.voteTime[ team ] )
return;
@@ -3074,13 +3074,16 @@ static void CG_DrawVote( team_t team )
if( sec < 0 )
sec = 0;
- Q_strncpyz( yeskey,
- CG_KeyBinding( va( "%svote yes", team == TEAM_NONE ? "" : "team" ) ),
- sizeof( yeskey ) );
- Q_strncpyz( nokey,
- CG_KeyBinding( va( "%svote no", team == TEAM_NONE ? "" : "team" ) ),
- sizeof( nokey ) );
- s = va( "%sVOTE(%i): \"%s\" called by \"%s" S_COLOR_WHITE "\" [%s]Yes:%i [%s]No:%i",
+ if( cg_tutorial.integer )
+ {
+ Com_sprintf( yeskey, sizeof( yeskey ), "[%s]",
+ CG_KeyBinding( va( "%svote yes", team == TEAM_NONE ? "" : "team" ) ) );
+ Com_sprintf( nokey, sizeof( nokey ), "[%s]",
+ CG_KeyBinding( va( "%svote no", team == TEAM_NONE ? "" : "team" ) ) );
+ }
+
+ s = va( "%sVOTE(%i): \"%s" S_COLOR_WHITE "\" called by \"%s"
+ S_COLOR_WHITE "\" %sYes:%i %sNo:%i",
team == TEAM_NONE ? "" : "TEAM", sec,
cgs.voteString[ team ], cgs.voteCaller[ team ],
yeskey, cgs.voteYes[ team ], nokey, cgs.voteNo[ team ] );
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index c6052eb4..175bd8b2 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1093,14 +1093,17 @@ void Cmd_CallVote_f( gentity_t *ent )
vote[ MAX_TOKEN_CHARS ],
arg[ MAX_TOKEN_CHARS ];
char name[ MAX_NAME_LENGTH ] = "";
- char *reason;
+ char caller[ MAX_NAME_LENGTH ] = "";
+ char reason[ MAX_TOKEN_CHARS ];
+ char *creason;
int clientNum = -1;
team_t team;
trap_Argv( 0, cmd, sizeof( cmd ) );
trap_Argv( 1, vote, sizeof( vote ) );
trap_Argv( 2, arg, sizeof( arg ) );
- reason = ConcatArgs( 3 );
+ creason = ConcatArgs( 3 );
+ G_DecolorString( creason, reason, sizeof( reason ) );
if( !Q_stricmp( cmd, "callteamvote" ) )
team = ent->client->pers.teamSelection;
@@ -1416,13 +1419,15 @@ void Cmd_CallVote_f( gentity_t *ent )
level.voteDisplayString[ team ] ) );
}
+ G_DecolorString( ent->client->pers.netname, caller, sizeof( caller ) );
+
level.voteTime[ team ] = level.time;
trap_SetConfigstring( CS_VOTE_TIME + team,
va( "%d", level.voteTime[ team ] ) );
trap_SetConfigstring( CS_VOTE_STRING + team,
level.voteDisplayString[ team ] );
trap_SetConfigstring( CS_VOTE_CALLER + team,
- ent->client->pers.netname );
+ caller );
ent->client->pers.namelog->voteCount++;
ent->client->pers.vote |= 1 << team;