Skip to content

Commit

Permalink
Do not show complaint popup in tournament mode
Browse files Browse the repository at this point in the history
  • Loading branch information
krazykaze81 committed Apr 14, 2021
1 parent 8892c36 commit 3f17483
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/cgame/cg_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2689,6 +2689,12 @@ static void CG_DrawVote( void ) {

if ( cgs.complaintEndTime > cg.time ) {

// RtcwPro exit complaint dialog if g_tournament is 1
const char* info = CG_ConfigString(CS_SERVERINFO);
char* isTournament = Info_ValueForKey(info, "g_tournament");
if (isTournament != NULL && strcmp(isTournament, "1") == 0)
return;

if ( cgs.complaintClient == -1 ) {
s = "Your complaint has been filed";
CG_DrawStringExt( 8, 200, CG_TranslateString( s ), color, qtrue, qfalse, TINYCHAR_WIDTH, TINYCHAR_HEIGHT, 80 );
Expand Down
3 changes: 3 additions & 0 deletions src/game/g_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,10 @@ void Cmd_Vote_f( gentity_t *ent ) {

// exit out for comp settings
if (g_tournament.integer == 1 || g_complaintlimit.integer == 0)
{
trap_SendServerCommand(ent - g_entities, "complaint -2");
return;
}

gclient_t *cl = g_entities[ ent->client->pers.complaintClient ].client;
if ( !cl ) {
Expand Down
2 changes: 1 addition & 1 deletion src/game/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ cvarTable_t gameCvarTable[] = {
{ &g_maxTeamFlamer, "g_maxTeamFlamer", "1", CVAR_ARCHIVE | CVAR_LATCH, 0, qtrue },
{ &g_duelAutoPause, "g_duelAutoPause", "0", CVAR_ARCHIVE, 0, qfalse },
{ &team_nocontrols, "team_nocontrols", "1", CVAR_ARCHIVE, 0, qfalse },
{ &g_tournament, "g_tournament", "0", CVAR_ARCHIVE | CVAR_LATCH, 0, qtrue },
{ &g_tournament, "g_tournament", "0", CVAR_ARCHIVE | CVAR_LATCH | CVAR_SERVERINFO, 0, qtrue },
{ &g_dbgRevive, "g_dbgRevive", "0", 0, 0, qfalse },
{ &g_dropWeapons, "g_dropWeapons", "9", CVAR_ARCHIVE, 0, qtrue, qtrue },
{ &g_hsDamage, "g_hsDamage", "50", CVAR_ARCHIVE, 0, qfalse, qtrue },
Expand Down

0 comments on commit 3f17483

Please sign in to comment.