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: Changed some ints to floats where they were being misused
Next bug: Persistent score doesn't get updated if there hasn't happened anything in the map

Bugfix 015 - No skill or XP displayed in the playerstat dropdown until a weapon has been fired

Problem:

After a new map has loaded, no XP or rank information is displayed on the playerstat dropdown, until a weapon has been fired.

Solution:

The problem is that the client was expecting the stats in one format and the server send it in another. This changes the server behavior to what the client expects.

Notes:

The bug is still present in version 2.60

2.56 & 2.60 Code

g_match.c @ 376 (2.56) @ 377 (2.60) // Add weapon stats as necessary
// CHRUKER: b015 - The client also expects stats when kills are above 0
for(i=WS_KNIFE; i<WS_MAX; i++) { if(refEnt->client->sess.aWeaponStats[i].atts || refEnt->client->sess.aWeaponStats[i].hits || refEnt->client->sess.aWeaponStats[i].deaths || refEnt->client->sess.aWeaponStats[i].kills) { dwWeaponMask |= (1 << i); Q_strcat(strWeapInfo, sizeof(strWeapInfo), va(" %d %d %d %d %d", refEnt->client->sess.aWeaponStats[i].hits, refEnt->client->sess.aWeaponStats[i].atts, refEnt->client->sess.aWeaponStats[i].kills, refEnt->client->sess.aWeaponStats[i].deaths, refEnt->client->sess.aWeaponStats[i].headshots)); } } // Additional info
// CHRUKER: b015 - Only send these when there are some weaponstats. This is what the client expects. if (dwWeaponMask != 0) {
Q_strcat(strWeapInfo, sizeof(strWeapInfo), va(" %d %d %d", refEnt->client->sess.damage_given, refEnt->client->sess.damage_received, refEnt->client->sess.team_damage));
} // b015
// Add skillpoints as necessary for(i=SK_BATTLE_SENSE; i<SK_NUM_SKILLS; i++) {
g_match.c @ 456 (2.56) @ 461 (2.60) }
// CHRUKER: b015 - These only gets generated when there are some weaponstats. This is what the client expects. if (dwWeaponMask != 0) {
GETVAL(cl->sess.damage_given); GETVAL(cl->sess.damage_received); GETVAL(cl->sess.team_damage);
} // b015
}

Show index
Previous bug: Changed some ints to floats where they were being misused
Next bug: Persistent score doesn't get updated if there hasn't happened anything in the map

Color coding

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

©2017 Chruker