Moderator: GZDoom Developers
function int abs(int x)
{
if (x>=0) return x;
return -x;
}
function int min(int x, int y)
{
if (x<y) return x;
else return y;
}
function int AproxDistance(int dx, int dy)
{
int dx = abs(dx);
int dy = abs(dy);
return dx+dy-(min(dx,dy)>>1);
}
function void GetDistance(int tid)
{
int x=abs(GetActorX(tid)-GetActorX(activatortid()));
int y=abs(GetActorY(tid)-GetActorY(activatortid()));
int z=abs(GetActorZ(tid)-GetActorZ(activatortid()));
return AproxDistance(AproxDistance(x,y), z);
}
cutmanmike wrote:Since you can do this in ACS anyway (with a bit more hassle) why not have this? A little low priority but there you go
Return to Closed Feature Suggestions
Users browsing this forum: No registered users and 0 guests