summaryrefslogtreecommitdiffstats
path: root/geo.c
diff options
context:
space:
mode:
Diffstat (limited to 'geo.c')
-rw-r--r--geo.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/geo.c b/geo.c
index 0f70eaf..976b668 100644
--- a/geo.c
+++ b/geo.c
@@ -28,15 +28,14 @@ insetRect(Rectangle r, float n) {
Vector *
noOverlapPositions(int n, Rectangle bounds, float radius) {
Vector *ps;
- Rectangle r;
int i, j;
if ((ps = malloc(n*sizeof(Vector))) == NULL)
sysfatal("Failed to allocate position array.\n");
- r = insetRect(bounds, radius);
+ bounds = insetRect(bounds, radius);
for (i = 0; i < n; i++) {
- ps[i] = randPtInRect(r);
+ ps[i] = randPtInRect(bounds);
for (j = 0; j < i; j++)
if (isCollision(ps[j], radius, ps[i], radius))
break;