Skip to content

Commit

Permalink
cgame: Fix ki trail length when reaching cvar limit, add a little mor…
Browse files Browse the repository at this point in the history
…e ki trail time and remove ki trail length minimum limit in the conditionals
  • Loading branch information
LegendaryGuard committed Nov 29, 2024
1 parent 79e100e commit b4ad560
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/cgame/cg_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -2372,9 +2372,9 @@ static void CG_Aura( centity_t *cent, int clientNum, clientInfo_t *ci, int rende

// BFP - Ki trail
if ( ( cent->currentState.legsAnim & ~ANIM_TOGGLEBIT ) != LEGS_CHARGE
&& cg_kiTrail.integer >= 10 ) {
&& cg_kiTrail.integer > 0 ) {
// apply time for using ki trail
cent->pe.kiTrailTime = cg.time + cg_kiTrail.integer*5;
cent->pe.kiTrailTime = cg.time + cg_kiTrail.integer*7;

CG_KiTrail( clientNum, kiTrailOrigin, qfalse, kiTrailShader );
} else { // handle when the ki trail was being used previously
Expand Down Expand Up @@ -2505,7 +2505,7 @@ static void CG_Aura( centity_t *cent, int clientNum, clientInfo_t *ci, int rende
}
} else {
// BFP - Ki trail being removed
if ( cg_kiTrail.integer >= 10 ) {
if ( cg_kiTrail.integer > 0 ) {
CG_RemoveKiTrails( cent, clientNum, kiTrailOrigin, kiTrailShader, qtrue );
}
}
Expand Down
4 changes: 4 additions & 0 deletions source/cgame/cg_trails.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ void CG_KiTrail( int entityNum, vec3_t origin, qboolean remove, qhandle_t hShade
kiTrailLength = TRAIL_SEGMENTS;
}

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

if ( i + j >= cg_trails[entityNum].numSegments - 1 ) {
return;
}
Expand Down

0 comments on commit b4ad560

Please sign in to comment.