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: Background images on the loading screen are not always shown
Next bug: During team switching you can sometime spawn immediately

Bugfix 080 - Breakable damage indicator can wrap when the entity has a lot of health

Problem:

Something in the engine is truncating the ps.serverCursorHintVal variable to 8 bit. However this means that the health bar would wrap.

Solution:

This code saves the highest hintVal and scales the hintVal to fit within the 0-255 interval. This make sure that the health bar will never wrap.

2.56 & 2.60 Code

g_main.c @ 679 playerState_t *ps; int hintType, hintDist, hintVal;
static int hintValMax = 255; // CHRUKER: b080 - Breakable damage indicator can wrap when the entity has a lot of health
qboolean zooming, indirectHit; // indirectHit means the checkent was not the ent hit by the trace (checkEnt!=traceEnt) int trace_contents; // DHM - Nerve
g_main.c @ 895 hintType = HINT_BREAKABLE; hintVal = checkEnt->health; // also send health to client for visualization
// CHRUKER: b080 - Breakable damage indicator can wrap when the entity has a lot of health if ( hintVal > hintValMax ) hintValMax = hintVal; hintVal = (hintVal * 255) / hintValMax;
break; case 1:
g_main.c @ 925 hintType = HINT_BREAKABLE; hintVal = checkEnt->health; // also send health to client for visualization
// CHRUKER: b080 - Breakable damage indicator can wrap when the entity has a lot of health if ( hintVal > hintValMax ) hintValMax = hintVal; hintVal = (hintVal * 255) / hintValMax;
} else { hintDist = 0;
g_main.c @ 949 hintType = HINT_BREAKABLE; hintVal = checkEnt->health; // also send health to client for visualization
// CHRUKER: b080 - Breakable damage indicator can wrap when the entity has a lot of health if ( hintVal > hintValMax ) hintValMax = hintVal; hintVal = (hintVal * 255) / hintValMax;
break; case 1:

Show index
Previous bug: Background images on the loading screen are not always shown
Next bug: During team switching you can sometime spawn immediately

Color coding

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

©2017 Chruker