From f26a86bcc78c1946f55b6a399039e3bd8fb5dd16 Mon Sep 17 00:00:00 2001 From: jacopo grandi Date: Mon, 22 Feb 2021 20:18:25 +0100 Subject: fix maxrange and testing --- gst/units.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gst/units.c') diff --git a/gst/units.c b/gst/units.c index 409f9b1..89c9489 100644 --- a/gst/units.c +++ b/gst/units.c @@ -64,7 +64,6 @@ void unit_remove (army *ar, map *m, unit *u) { ar->uslen--; ar->grid[xytoi(m, tx, ty)] = u; ar->grid[xytoi(m, ux, uy)] = NULL; - printf("ar->uslen: %d\n", ar->uslen); } void unit_dead (army *ar, map *m, unit *u) { @@ -76,7 +75,6 @@ void unit_search (infos *info, army *ar, map *m, unit *u, { for (int f=0; f<32; t[f] = NULL, f++); int mult[4][2] = { {1, 1},{1,-1},{-1,-1},{-1,1} }, x, y, dx, dy, tmp; - *t = NULL; for (int r=1; rgridpos[0] - (*t)->gridpos[0], u->gridpos[1] - (*t)->gridpos[1] - }; float mag = vec2_mag(diff); - if (mag > range) *t = NULL; + }; float mag = vec2_mag2(diff); + if (mag > range*range) *t = NULL; } }}} } -- cgit v1.2.3-54-g00ecf