From: Joshua Grams Date: Sun, 10 Jul 2005 20:55:04 +0000 (+0000) Subject: oops, fixed off-by-one error in new_engine_dots X-Git-Tag: 0.4~43 X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=commitdiff_plain;h=d918241a08d6e8b1cc10b3c682edde8876a492ef oops, fixed off-by-one error in new_engine_dots --- diff --git a/main.c b/main.c index d9e81ef..258ecd3 100644 --- a/main.c +++ b/main.c @@ -230,9 +230,10 @@ draw_engine_dots(SDL_Surface *s) { if(edot[i].active) { edot[i].x += edot[i].dx*t_frame - xscroll; edot[i].y += edot[i].dy*t_frame - yscroll; - if((edot[i].life -= t_frame*3)<0 || edot[i].y<0 || edot[i].y>YSIZE) { - edot[i].active = 0; - } else if(edot[i].x<0 || edot[i].x>XSIZE) { + edot[i].life -= t_frame*3; + if(edot[i].life < 0 + || edot[i].y<0 || edot[i].y >= YSIZE + || edot[i].x<0 || edot[i].x >= XSIZE) { edot[i].active = 0; } else { int heatindex; @@ -275,7 +276,7 @@ new_engine_dots(int n, int dir) { dotptr->life = 60 * fabs(dx); } - if(dotptr - edot < MAXENGINEDOTS) dotptr++; + if(dotptr - edot < MAXENGINEDOTS-1) dotptr++; else dotptr = edot; } }