version 1.6 | | version 1.7 |
---|
| | |
/* | | /* |
* static char *rcsid_los_c = | | * static char *rcsid_los_c = |
* "$Id: los.c,v 1.6 2001/10/30 00:49:02 michtoen Exp $"; | | * "$Id: los.c,v 1.7 2001/10/30 02:30:19 michtoen Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
d1 = (float) (pow(MAP_CLIENT_X/2 - dx, 2) + pow(MAP_CLIENT_Y/2 - dy,2)); | | d1 = (float) (pow(MAP_CLIENT_X/2 - dx, 2) + pow(MAP_CLIENT_Y/2 - dy,2)); |
r = (float)((dy-y)*(dy - MAP_CLIENT_Y/2) - (dx-x)*(MAP_CLIENT_X/2-dx))/d1; | | r = (float)((dy-y)*(dy - MAP_CLIENT_Y/2) - (dx-x)*(MAP_CLIENT_X/2-dx))/d1; |
s = (float)((dy-y)*(MAP_CLIENT_X/2 - dx ) - (dx-x)*(MAP_CLIENT_Y/2-dy))/d1; | | s = (float)((dy-y)*(MAP_CLIENT_X/2 - dx ) - (dx-x)*(MAP_CLIENT_Y/2-dy))/d1; |
l = (float) FABS(sqrt(d1) * s); | | l = FABS(sqrt(d1) * s); |
| | |
if (l <= SPACE_BLOCK) { | | if (l <= SPACE_BLOCK) { |
/* For simplicity, we mirror the coordinates to block the other | | /* For simplicity, we mirror the coordinates to block the other |