int GetDistanceBetween(bool isObj1, int b, int c, bool isObj2, int e, int f)
{
int i, j;
Point pos1;
Point pos2;
j = i = 0xFF;
if (isObj1)
{
if (!GetObjectOrActorXY(b, out pos1))
return -1;
if (b < Actors.Length)
i = Actors[b].ScaleX;
}
else
{
pos1 = new Point(b, c);
}
if (isObj2)
{
if (!GetObjectOrActorXY(e, out pos2))
return -1;
if (e < Actors.Length)
j = Actors[e].ScaleX;
}
else
{
pos2 = new Point(e, f);
}
return ScummMath.GetDistance(pos1, pos2) * 0xFF / ((i + j) / 2);
}