Enemy Territory

Project: Bug Fix

The objective

The goal of this project is to provide modders in the ET community with a SDK code base that contains fixes for various bugs which are present in the stock etmain game (version 2.60).

26th september 2006: Sadly bugfix 088 had a bug :-( There were 3 lines that should have been deleted for the fix to work correctly.

Show index
Previous bug: Output from various commands are cluttering the popupmessages
Next bug: Warmup damage change notifications has been moved from console-only to popup messages

Bugfix 047 - Output from various referee commands had typos

Problem:

Many of the functions calling G_refPrintf added a linebreak. This maybe because the function didn't add one when printing to the server console. However it added when printing to the client console.

Solution:

This fix adds a linebreak to the server console print, and removes the now unneeded linebreaks. A few commands also had other typos.

Notes:

The bug is still present in version 2.60
I left a few linebreaks in there where I would suspect the OSP people added them to have extra linebreaks in the console.

2.56 & 2.60 Code

g_referee.c @ 163 (2.56) @ 172 (2.60) status = va("Referee has ^3%sLOCKED^7 teams", ((fLock) ? "" : "UN")); // CHRUKER: b041 - Was only sending this to ent, but it should be broadcasted G_printFull(status, NULL); G_refPrintf(ent, "You have %sLOCKED teams\n", ((fLock) ? "" : "UN")); // CHRUKER: b047 - Removed unneeded linebreak if( fLock ) {
g_referee.c @ 182 (2.56) @ 192 (2.60) if((PAUSE_UNPAUSING >= level.match_pause && !fPause) || (PAUSE_NONE != level.match_pause && fPause)) { G_refPrintf(ent, "The match is already %sPAUSED!\n\"", status[fPause]); // CHRUKER: b047 - Removed unneeded \" and linebreak return; }
g_referee.c @ 198 (2.56) @ 208 (2.60) trap_SetConfigstring(CS_SERVERTOGGLES, va("%d", level.server_settings)); } else { AP(va("print \"\n^3%s ^5UNPAUSES^3 the match ... resuming in 10 seconds!\n\n\"", referee)); // CHRUKER: b047 - Had extra linebreaks, before and after level.match_pause = PAUSE_UNPAUSING; G_globalSound("sound/osp/prepare.wav");
g_referee.c @ 228 (2.56) @ 238 (2.60) // Can only move to other teams. if(player->client->sess.sessionTeam == team_id) { G_refPrintf(ent, "\"%s\" is already on team %s!\n", player->client->pers.netname, aTeams[team_id]); // CHRUKER: b047 - Removed unneeded linebreak return; } if(team_maxplayers.integer && TeamCount(-1, team_id) >= team_maxplayers.integer) { G_refPrintf(ent, "Sorry, the %s team is already full!\n", aTeams[team_id]); // CHRUKER: b047 - Removed unneeded linebreak return; }
g_referee.c @ 320 (2.56) @ 331 (2.60) if(!*cmd || atoi(cmd) < 0) { trap_Cvar_VariableStringBuffer( "g_warmup", cmd, sizeof(cmd)); G_refPrintf(ent, "Warmup Time: %d\n", atoi(cmd)); // CHRUKER: b047 - Removed unneeded linebreak return; }
g_referee.c @ 367 (2.56) @ 378 (2.60) if( player->client->sess.referee != RL_NONE ) { G_refPrintf(ent, "Cannot mute a referee.\n" ); // CHRUKER: b047 - Removed unneeded linebreak return; } if(player->client->sess.muted == mute) { G_refPrintf(ent, "\"%s^*\" %s\n", player->client->pers.netname, mute ? "is already muted!" : "is not muted!" ); // CHRUKER: b047 - Removed unneeded linebreak return; }
g_referee.c @ 569 (2.56) @ 580 (2.60) va_end (argptr); if(ent == NULL) trap_Printf(va("%s\n", text)); // CHRUKER: b047 - Added linebreak to the string else CP(va("print \"%s\n\"", text)); // CHRUKER: b046 - Was using the cpm command, but this is really just for the console }
g_vote.c @ 742 if(arg) { if(trap_Argc() > 2) { G_refPrintf(ent, "Usage: ^3%s %s%s\n\n", ((fRefereeCmd) ? "\\ref" : "\\callvote"), arg, aVoteInfo[dwVoteIndex].pszVoteHelp); // CHRUKER: b047 - Removed unneeded linebreak return(G_INVALID); } else if(!vote_allow_shuffleteamsxp.integer && ent && !ent->client->sess.referee) {

Show index
Previous bug: Output from various commands are cluttering the popupmessages
Next bug: Warmup damage change notifications has been moved from console-only to popup messages

Color coding

Sample = New code
Sample = Changed code (the new version is what is displayed)
Sample = Deleted code

©2017 Chruker