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:
Zack Middleton 2017-06-24 19:53:37 -05:00
parent 520b100449
commit c2ca5e7856
2 changed files with 16 additions and 6 deletions

View file

@ -1197,10 +1197,15 @@ static float CG_DrawPowerups( float y ) {
if ( !ps->powerups[ i ] ) { if ( !ps->powerups[ i ] ) {
continue; 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 // 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; continue;
} }

View file

@ -832,10 +832,15 @@ static void CG_DrawAreaPowerUp(rectDef_t *rect, int align, float special, float
if ( !ps->powerups[ i ] ) { if ( !ps->powerups[ i ] ) {
continue; 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 // 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; continue;
} }