From b4ad56066da912c7e319663ed95f93885ff07352 Mon Sep 17 00:00:00 2001 From: LegendaryGuard Date: Fri, 29 Nov 2024 16:30:21 +0100 Subject: [PATCH] cgame: Fix ki trail length when reaching cvar limit, add a little more ki trail time and remove ki trail length minimum limit in the conditionals --- source/cgame/cg_players.c | 6 +++--- source/cgame/cg_trails.c | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/cgame/cg_players.c b/source/cgame/cg_players.c index f665bdf..a7bde6f 100644 --- a/source/cgame/cg_players.c +++ b/source/cgame/cg_players.c @@ -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 @@ -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 ); } } diff --git a/source/cgame/cg_trails.c b/source/cgame/cg_trails.c index 15242e8..c0f7e01 100644 --- a/source/cgame/cg_trails.c +++ b/source/cgame/cg_trails.c @@ -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; }