Clean up CG_DrawProxWarning design

Hopefully fixes the following warning
cg_draw.c:2315 assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
This commit is contained in:
Zack Middleton 2015-03-20 21:09:04 -05:00
parent c4a2836269
commit 5fb49acda8

View file

@ -2298,8 +2298,7 @@ static void CG_DrawProxWarning( void ) {
char s [32];
int w;
static int proxTime;
static int proxCounter;
static int proxTick;
int proxTick;
if( !(cg.snap->ps.eFlags & EF_TICKING ) ) {
proxTime = 0;
@ -2307,17 +2306,12 @@ static void CG_DrawProxWarning( void ) {
}
if (proxTime == 0) {
proxTime = cg.time + 5000;
proxCounter = 5;
proxTick = 0;
proxTime = cg.time;
}
if (cg.time > proxTime) {
proxTick = proxCounter--;
proxTime = cg.time + 1000;
}
proxTick = 10 - ((cg.time - proxTime) / 1000);
if (proxTick != 0) {
if (proxTick > 0 && proxTick <= 5) {
Com_sprintf(s, sizeof(s), "INTERNAL COMBUSTION IN: %i", proxTick);
} else {
Com_sprintf(s, sizeof(s), "YOU HAVE BEEN MINED");