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: Flamethrower serverside chunks can fly across the map if aimed properly
Next bug: 'give skill' command now uses the set skill levels instead of giving 140 XP no matter what

Bugfix 063 - Players can appear duplicated in the scoreboard on large servers

Problem:

The name was copied into the buffer before it check if it would go beyond the max number send. Also i would be decrease causing two players to be repeated.

Solution:

Only copy the name to the buffer after all checks, and don't decrease the i pointer.

Notes:

The bug is still present in version 2.60

2.56 & 2.60 Code

g_cmds.c @ 90
// Make sure the entry can fit in the buffer. If not break away and send the buffer content
if(size + strlen(entry) > 1000) {
// CHRUKER: b063 - Removed the line which decreased i
i--; // we need to redo this client in the next buffer (if we can)
break; }
// Copy the entry into the send buffer
size += strlen(entry);
Q_strcat(buffer, 1024, entry);
// Send a maximum of 31 players in one packet
if( ++count >= 32 ) {
// CHRUKER: b063 - Changed the line that decreased i, so it points to the next player
i++; // we need to redo this client in the next buffer (if we can) break; } }

Show index
Previous bug: Flamethrower serverside chunks can fly across the map if aimed properly
Next bug: 'give skill' command now uses the set skill levels instead of giving 140 XP no matter what

Color coding

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

©2017 Chruker