summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2010-10-20 07:05:34 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:42 +0000
commite76d590dc99030ce2756640954f81da1d354ed76 (patch)
treef14d5ee4968fcf537b6f7b2c597a577133bfbba4 /src/game
parentc2492c48e1102278997f47ebd5380f4d7442c14f (diff)
* (Bug 4649) Require reasons for votes (WilliamH, Chris "Lakitu7" Schwarz)
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_cmds.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 13d27f4f..cbcc18b7 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -1093,12 +1093,14 @@ void Cmd_CallVote_f( gentity_t *ent )
vote[ MAX_TOKEN_CHARS ],
arg[ MAX_TOKEN_CHARS ];
char name[ MAX_NAME_LENGTH ] = "";
+ char *reason;
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 );
if( !Q_stricmp( cmd, "callteamvote" ) )
team = ent->client->pers.teamSelection;
@@ -1192,6 +1194,13 @@ void Cmd_CallVote_f( gentity_t *ent )
va( "print \"%s: player is not on your team\n\"", cmd ) );
return;
}
+
+ if( !reason[ 0 ] && !G_admin_permission( ent, ADMF_UNACCOUNTABLE ) )
+ {
+ trap_SendServerCommand( ent-g_entities,
+ va( "print \"%s: You must provide a reason\n\"", cmd ) );
+ return;
+ }
}
}
@@ -1205,11 +1214,16 @@ void Cmd_CallVote_f( gentity_t *ent )
}
Com_sprintf( level.voteString[ team ], sizeof( level.voteString[ team ] ),
- "ban %s \"1s%s\" vote kick", level.clients[ clientNum ].pers.ip.str,
- g_adminTempBan.string );
+ "ban %s \"1s%s\" vote kick (%s)", level.clients[ clientNum ].pers.ip.str,
+ g_adminTempBan.string, reason );
Com_sprintf( level.voteDisplayString[ team ],
- sizeof( level.voteDisplayString[ team ] ),
- "Kick player '%s'", name );
+ 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 );
+ }
}
else if( team == TEAM_NONE )
{
@@ -1227,6 +1241,12 @@ void Cmd_CallVote_f( gentity_t *ent )
Com_sprintf( level.voteDisplayString[ team ],
sizeof( level.voteDisplayString[ team ] ),
"Mute player '%s'", name );
+ if( reason[ 0 ] )
+ {
+ Com_sprintf( level.voteDisplayString[ team ],
+ sizeof( level.voteDisplayString[ team ] ), "%s for '%s'",
+ level.voteDisplayString[ team ], reason );
+ }
}
else if( !Q_stricmp( vote, "unmute" ) )
{
@@ -1342,6 +1362,12 @@ void Cmd_CallVote_f( gentity_t *ent )
Com_sprintf( level.voteDisplayString[ team ],
sizeof( level.voteDisplayString[ team ] ),
"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 );
+ }
}
else if( !Q_stricmp( vote, "allowbuild" ) )
{