summaryrefslogtreecommitdiff
path: root/src/cgame/cg_draw.c
diff options
context:
space:
mode:
authorMichael Levin <risujin@fastmail.fm>2009-10-03 11:28:39 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:02 +0000
commit861b96715156ed2260676b0f8f5d838bd1c6db51 (patch)
tree0aa0f33f9ec93892a196a15e54b8580694cba94e /src/cgame/cg_draw.c
parent7dc6cdc303b3db291b854566d88836eaa7842836 (diff)
Oops, small mistake. Construction kit won't show a charge bar now.
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;
}