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: Coverts shouldn't loose their uniform for using the binoculars
Next bug: Various typos in the scripting system

Bugfix 055 - Error messages in the scripting system were printing the wrong index ranges

Problem:

A lot of the game and ai accum / globalaccum commands were using the wrong index numbers, and wrong index ranges were printed in the help text.

Solution:

Updating them with the changes below.

Notes:

The bug is still present in version 2.60

2.56 & 2.60 Code

ai_script_actions.c @ 332 (2.56) @ 333 (2.60) bufferIndex = atoi(token); if (bufferIndex >= MAX_SCRIPT_ACCUM_BUFFERS) {
// CHRUKER: b055 - Was printing 8 as the last bufferindex, but its actually 7
Bot_ScriptError( bs, "accum: buffer is outside range (0 - %i)", MAX_SCRIPT_ACCUM_BUFFERS-1 ); }
ai_script_actions.c @ 1004 (2.56) @ 1006 (2.60) bufferIndex = atoi(token); if (bufferIndex >= MAX_SCRIPT_ACCUM_BUFFERS) {
// CHRUKER: b055 - Was printing 8 as the last bufferindex, but its actually 7
Bot_ScriptError( bs, "globalAccum: buffer is outside range (0 - %i)", MAX_SCRIPT_ACCUM_BUFFERS-1 ); }
ai_script_actions.c @ 1619 (2.56) @ 1622 (2.60) bufferIndex = atoi(token);
// CHRUKER: b055 - Was using MAX_SCRIPT_ACCUM_BUFFERS, which is a different limit
if ((bufferIndex < 0) || (bufferIndex >= G_MAX_SCRIPT_ACCUM_BUFFERS) ) {
// CHRUKER: b055 - Was printing 8 as the last bufferindex, but its actually 9
G_Error("Bot_ScriptAction_PrintAccum: buffer is outside range (0 - %i)", G_MAX_SCRIPT_ACCUM_BUFFERS-1 ); }
ai_script_actions.c @ 1662 (2.56) @ 1667 (2.60) if ((bufferIndex < 0) || (bufferIndex >= MAX_SCRIPT_ACCUM_BUFFERS) ) {
// CHRUKER: b055 - Was printing 8 as the last bufferindex, but its actually 7
G_Error("PrintGlobalAccum: buffer is outside range (0 - %i)", MAX_SCRIPT_ACCUM_BUFFERS-1 ); }
g_script_actions.c @ 593 (2.56) @ 594 (2.60) bufferIndex = atoi(token);
// CHRUKER: b055 - Was using G_MAX_SCRIPT_ACCUM_BUFFERS, which can result in a wrong index
if (bufferIndex < 0 || bufferIndex >= G_MAX_SCRIPT_ACCUM_BUFFERS) {
// CHRUKER: b055 - Was using G_MAX_SCRIPT_ACCUM_BUFFERS, which can result in a wrong index
G_Error( "G_Scripting: accum buffer is outside range (0 - %i)\n", G_MAX_SCRIPT_ACCUM_BUFFERS-1 ); }
g_script_actions.c @ 1953 (2.56) @ 1956 (2.60) bufferIndex = atoi(token); if (bufferIndex >= G_MAX_SCRIPT_ACCUM_BUFFERS) {
// CHRUKER: b055 - Was printing 10 as the last bufferindex, but its actually 9
G_Error( "G_Scripting: accum buffer is outside range (0 - %i)\n", G_MAX_SCRIPT_ACCUM_BUFFERS-1 ); }
g_script_actions.c @ 2146 (2.56) @ 2150 (2.60) bufferIndex = atoi(token);
// CHRUKER: b055 - Was using G_MAX_SCRIPT_ACCUM_BUFFERS, which would result in invalid indexes
if (bufferIndex >= G_MAX_SCRIPT_ACCUM_BUFFERS) {
// CHRUKER: b055 - Was printing 10 as the last bufferindex, but its actually 7
G_Error( "G_Scripting: accum buffer is outside range (0 - %i)\n", G_MAX_SCRIPT_ACCUM_BUFFERS-1 ); }
g_script_actions.c @ 3452 (2.56) @ 3458 (2.60) bufferIndex = atoi(token);
// CHRUKER: b055 - Was using MAX_SCRIPT_ACCUM_BUFFERS which is a different limit
if ((bufferIndex < 0) || (bufferIndex >= G_MAX_SCRIPT_ACCUM_BUFFERS) ) {
// CHRUKER: b055 - Was printing 8 as the last buffer index and using MAX_SCRIPT_ACCUM_BUFFERS, but its actually 9
G_Error("G_ScriptAction_PrintAccum: buffer is outside range (0 - %i)", G_MAX_SCRIPT_ACCUM_BUFFERS-1 ); }
g_script_actions.c @ 3493 (2.56) @ 3500 (2.60) if ((bufferIndex < 0) || (bufferIndex >= MAX_SCRIPT_ACCUM_BUFFERS) ) {
// CHRUKER: b055 - Was printing 8 as the last buffer index, but its actually 7
G_Error("PrintGlobalAccum: buffer is outside range (0 - %i)", MAX_SCRIPT_ACCUM_BUFFERS-1 ); }

Show index
Previous bug: Coverts shouldn't loose their uniform for using the binoculars
Next bug: Various typos in the scripting system

Color coding

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

©2017 Chruker