X-Git-Url: https://jasonwoof.com/gitweb/?p=vor.git;a=blobdiff_plain;f=main.c;h=258ecd3df09b30709e01c874a3afea2a6342f758;hp=d9e81ef425d01f59206ea385445b2261ea75262d;hb=d918241a08d6e8b1cc10b3c682edde8876a492ef;hpb=0d91ceac599dbeb19919bac2a1aa3f85ce7d4600 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; } }