Check for unlimited time power up using INT_MAX
It is possible for a power up to exceed 999 seconds without it being unlimited time.
This commit is contained in:
1 parent
520b100449
commit
c2ca5e7856
2 files changed
+16
-6
No files matched your search
@@ -1197,10 +1197,15 @@ static float CG_DrawPowerups( float y ) {
|
||||
if ( !ps->powerups[ i ] ) {
|
||||
continue;
|
||||
}
|
||||
t = ps->powerups[ i ] - cg.time;
|
||||
// ZOID--don't draw if the power up has unlimited time (999 seconds)
|
||||
|
||||
// ZOID--don't draw if the power up has unlimited time
|
||||
// This is true of the CTF flags
|
||||
if ( t < 0 || t > 999000) {
|
||||
if ( ps->powerups[ i ] == INT_MAX ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
t = ps->powerups[ i ] - cg.time;
|
||||
if ( t <= 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -832,10 +832,15 @@ static void CG_DrawAreaPowerUp(rectDef_t *rect, int align, float special, float
|
||||
if ( !ps->powerups[ i ] ) {
|
||||
continue;
|
||||
}
|
||||
t = ps->powerups[ i ] - cg.time;
|
||||
// ZOID--don't draw if the power up has unlimited time (999 seconds)
|
||||
|
||||
// ZOID--don't draw if the power up has unlimited time
|
||||
// This is true of the CTF flags
|
||||
if ( t <= 0 || t >= 999000) {
|
||||
if ( ps->powerups[ i ] == INT_MAX ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
t = ps->powerups[ i ] - cg.time;
|
||||
if ( t <= 0 ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user