Idk why, I think I'm missing something :s, well, here's the distance.acs code
Code: Select all
#library "distance"
function int sqrt2 (int x){
int r;
x = x + 1 >> 1;
while (x > r)
x -= r++;
return r;
}
function int ibm_distance (int tid1, int tid2){
int x, y, z, d;
x = (GetActorX(tid1) - GetActorX(tid2))/65536;
y = (GetActorY(tid1) - GetActorY(tid2))/65536;
z = (GetActorZ(tid1) - GetActorZ(tid2))/65536;
d = sqrt2( x*x + y*y + z*z );
return d;
}Am I missing something?