JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
made closest stars a bit further away
[vor.git] / rocks.c
diff --git a/rocks.c b/rocks.c
index 2a9c906..ca921cf 100644 (file)
--- a/rocks.c
+++ b/rocks.c
@@ -107,7 +107,6 @@ new_rocks(void)
 {
        int i,j;
        float ti[4];
-       float x, y;
 
        rock_timer_increments(ti);
 
@@ -143,16 +142,8 @@ new_rocks(void)
                                                break;
                                }
 
-                               j=0;
-                               do {
-                                       rockptr->dx = RDX*crnd();
-                                       rockptr->dy = RDY*crnd();
-                                       x = (rockptr->dx-screendx)*gamerate;
-                                       y = (rockptr->dy-screendy)*gamerate;
-                                       j++;
-                               } while(x < -rockptr->image->w || x >= XSIZE
-                                               || y < -rockptr->image->h || y >= YSIZE);
-                               if(j > 1) fprintf(stderr, "had to try %d times.\n", j);
+                               rockptr->dx = RDX*crnd();
+                               rockptr->dy = RDY*crnd();
 
                                rockptr->active = 1;
                        }
@@ -224,6 +215,8 @@ blast_rocks(float x, float y, float radius, int onlyslow)
        int i;
        float dx, dy, n;
 
+       if(onlyslow) return;
+
        for(i = 0; i<MAXROCKS; i++ ) {
                if(rock[i].x <= 0) continue;
 
@@ -237,8 +230,8 @@ blast_rocks(float x, float y, float radius, int onlyslow)
 
                n = sqrt(dx*dx + dy*dy);
                if(n < radius) {
-                       n *= 20;
-                       rock[i].dx += 54.0*(dx+30)/n;
+                       n *= 15;
+                       rock[i].dx += 54.0*dx/n;
                        rock[i].dy += 54.0*dy/n;
                }
        }