summaryrefslogtreecommitdiff
path: root/src/cgame/cg_draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame/cg_draw.c')
-rw-r--r--src/cgame/cg_draw.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index 32b7f44b..e99d48d1 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -925,14 +925,19 @@ static float CG_ChargeProgress( void )
min = LCANNON_CHARGE_TIME_MIN;
max = LCANNON_CHARGE_TIME_MAX;
}
- if( max - min < 0.0f )
+
+ if( max - min <= 0.0f )
return 0.0f;
+
progress = ( (float)cg.predictedPlayerState.stats[ STAT_MISC ] - min ) /
( max - min );
+
if( progress > 1.0f )
return 1.0f;
+
if( progress < 0.0f )
return 0.0f;
+
return progress;
}