float comparison isn't working?

code in question:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void checkcollision()
{
	float x1 = tanks[0].x;
	float y1 = tanks[0].y;
	float x2 = tanks[1].x;
	float y2 = tanks[1].y;
	float dist = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
	float dr = tanks[0].rad+tanks[1].rad;
	if(dist<dr);
	{
		printf("checkcollision read true\n");
		printf("dist: %f, radius+radius: %f\n",dist,dr);
		goback(0); goback(1);
	}
}


console output:

1
2
3
4
checkcollision read true
dist:363.159302, radius+radius:14.142136
goback executed for tank 1
goback executed for tank 2


full source file:
https://docs.google.com/open?id=0B4UPOuCR5uRGakZlRHpMUHFpMEE

I uploaded the whole project folder via Google Docs (I compile via MinGW so no VS proj file)
I have no idea how I can send a link to the folder itself if anyone knows if this is possible, even if you won't answer the question please let me know immediately. you know what screw it here's the zip:
https://docs.google.com/open?id=0B4UPOuCR5uRGc3U3R2luelFoWTg
if(dist/dr) compare to if(dist/dr);

heh
Good spotting dancks - those pesky semicolons !!
Topic archived. No new replies allowed.