diff options
author | M. Kristall <mkpdev@gmail.com> | 2010-10-20 07:05:34 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:17:42 +0000 |
commit | e76d590dc99030ce2756640954f81da1d354ed76 (patch) | |
tree | f14d5ee4968fcf537b6f7b2c597a577133bfbba4 /src/ui | |
parent | c2492c48e1102278997f47ebd5380f4d7442c14f (diff) |
* (Bug 4649) Require reasons for votes (WilliamH, Chris "Lakitu7" Schwarz)
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui_main.c | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index d29fe4d5..f581e944 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -3204,16 +3204,26 @@ static void UI_RunMenuScript( char **args ) { if( uiInfo.playerIndex >= 0 && uiInfo.playerIndex < uiInfo.playerCount ) { - trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote kick %d\n", - uiInfo.clientNums[ uiInfo.playerIndex ] ) ); + char buffer[ MAX_CVAR_VALUE_STRING ]; + trap_Cvar_VariableStringBuffer( "ui_reason", buffer, sizeof( buffer ) ); + + trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote kick %d %s\n", + uiInfo.clientNums[ uiInfo.playerIndex ], + buffer ) ); + trap_Cvar_Set( "ui_reason", "" ); } } else if( Q_stricmp( name, "voteMute" ) == 0 ) { if( uiInfo.playerIndex >= 0 && uiInfo.playerIndex < uiInfo.playerCount ) { - trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote mute %d\n", - uiInfo.clientNums[ uiInfo.playerIndex ] ) ); + char buffer[ MAX_CVAR_VALUE_STRING ]; + trap_Cvar_VariableStringBuffer( "ui_reason", buffer, sizeof( buffer ) ); + + trap_Cmd_ExecuteText( EXEC_APPEND, va( "callvote mute %d %s\n", + uiInfo.clientNums[ uiInfo.playerIndex ], + buffer ) ); + trap_Cvar_Set( "ui_reason", "" ); } } else if( Q_stricmp( name, "voteUnMute" ) == 0 ) @@ -3228,16 +3238,26 @@ static void UI_RunMenuScript( char **args ) { if( uiInfo.teamPlayerIndex >= 0 && uiInfo.teamPlayerIndex < uiInfo.myTeamCount ) { - trap_Cmd_ExecuteText( EXEC_APPEND, va( "callteamvote kick %d\n", - uiInfo.teamClientNums[ uiInfo.teamPlayerIndex ] ) ); + char buffer[ MAX_CVAR_VALUE_STRING ]; + trap_Cvar_VariableStringBuffer( "ui_reason", buffer, sizeof( buffer ) ); + + trap_Cmd_ExecuteText( EXEC_APPEND, va( "callteamvote kick %d %s\n", + uiInfo.teamClientNums[ uiInfo.teamPlayerIndex ], + buffer ) ); + trap_Cvar_Set( "ui_reason", "" ); } } else if( Q_stricmp( name, "voteTeamDenyBuild" ) == 0 ) { if( uiInfo.teamPlayerIndex >= 0 && uiInfo.teamPlayerIndex < uiInfo.myTeamCount ) { - trap_Cmd_ExecuteText( EXEC_APPEND, va( "callteamvote denybuild %d\n", - uiInfo.teamClientNums[ uiInfo.teamPlayerIndex ] ) ); + char buffer[ MAX_CVAR_VALUE_STRING ]; + trap_Cvar_VariableStringBuffer( "ui_reason", buffer, sizeof( buffer ) ); + + trap_Cmd_ExecuteText( EXEC_APPEND, va( "callteamvote denybuild %d %s\n", + uiInfo.teamClientNums[ uiInfo.teamPlayerIndex ], + buffer ) ); + trap_Cvar_Set( "ui_reason", "" ); } } else if( Q_stricmp( name, "voteTeamAllowBuild" ) == 0 ) |