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: Players can appear duplicated in the scoreboard on large servers
Next bug: 'follow' error message when you are in limbo state was cluttering the popup messages

Bugfix 064 - 'give skill' command now uses the set skill levels instead of giving 140 XP no matter what

Problem:

The code just gave 20 points per skill, instead of using the skilllevels defined other places.

Solution:

Use the skilllevels.

Notes:

The bug is still present in version 2.60

2.56 & 2.60 Code

g_cmds.c @ 304 (2.56) @ 309 (2.60) // trace_t trace; int amount;
int skill; // CHRUKER: b064 - Added skill
qboolean hasAmount = qfalse;
g_cmds.c @ 326 (2.56) @ 332 (2.60) if( Q_stricmpn( name, "skill", 5 ) == 0 ) { if( hasAmount ) {
if( amount >= 0 && amount < SK_NUM_SKILLS ) { G_AddSkillPoints( ent, amount, 20 ); G_DebugAddSkillPoints( ent, amount, 20, "give skill" ); }
skill = amount; // CHRUKER: b064 - Changed amount to skill, so that we can use amount properly if( skill >= 0 && skill < SK_NUM_SKILLS ) { // CHRUKER: b064 - Detecting the correct amount to move to the next skill level amount = 20; if ( ent->client->sess.skill[skill] < NUM_SKILL_LEVELS-1 ) amount = skillLevels[ent->client->sess.skill[skill] + 1] - ent->client->sess.skillpoints[skill]; G_AddSkillPoints( ent, skill, amount ); G_DebugAddSkillPoints( ent, skill, amount, "give skill" ); // b064 }
} else { // bumps all skills with 1 level for( i = 0; i < SK_NUM_SKILLS; i++ ) {
G_AddSkillPoints( ent, i, 20 ); G_DebugAddSkillPoints( ent, i, 20, "give skill" );
// CHRUKER: b064 - Detecting the correct amount to move to the next skill level amount = 20; if ( ent->client->sess.skill[i] < NUM_SKILL_LEVELS-1 ) amount = skillLevels[ent->client->sess.skill[i] + 1] - ent->client->sess.skillpoints[i]; G_AddSkillPoints( ent, i, amount ); G_DebugAddSkillPoints( ent, i, amount, "give skill" ); // b064
} } return; }

Show index
Previous bug: Players can appear duplicated in the scoreboard on large servers
Next bug: 'follow' error message when you are in limbo state was cluttering the popup messages

Color coding

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

©2017 Chruker