Skip to content

Commit

Permalink
cgame: Correct the number of ki trail segments
Browse files Browse the repository at this point in the history
  • Loading branch information
LegendaryGuard committed Dec 10, 2024
1 parent 7375ddf commit a384da3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/cgame/cg_trails.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ Adds ki trail segments
void CG_KiTrail( int entityNum, vec3_t origin, qboolean remove, qhandle_t hShader ) {
int i, j;
polyVert_t verts[4];
int kiTrailLength = cg_kiTrail.integer;

if ( kiTrailLength > TRAIL_SEGMENTS ) {
kiTrailLength = TRAIL_SEGMENTS;
}

if ( entityNum < 0 || entityNum >= MAX_GENTITIES ) {
return;
Expand All @@ -69,7 +74,7 @@ void CG_KiTrail( int entityNum, vec3_t origin, qboolean remove, qhandle_t hShade
if ( remove ) { // removes every segment
cg_trails[entityNum].numSegments--;
} else {
if ( cg_trails[entityNum].numSegments < TRAIL_SEGMENTS ) {
if ( cg_trails[entityNum].numSegments < kiTrailLength ) {
cg_trails[entityNum].numSegments++;
}
}
Expand All @@ -87,11 +92,6 @@ void CG_KiTrail( int entityNum, vec3_t origin, qboolean remove, qhandle_t hShade
for ( j = 0; j < 3; ++j ) {
vec3_t start, end, forward, right;
vec3_t viewAxis;
int kiTrailLength = cg_kiTrail.integer;

if ( kiTrailLength > TRAIL_SEGMENTS ) {
kiTrailLength = TRAIL_SEGMENTS;
}

if ( i + j >= kiTrailLength ) {
return;
Expand Down

0 comments on commit a384da3

Please sign in to comment.