It seems you try to get the real distance (taking into account the greater distance in diagonals).
Why don't you get the real distance from the very beginning then?
That is, replacing getManhattan by
NB: I also removed this " * 1 " (!?!)
Why don't you get the real distance from the very beginning then?
That is, replacing getManhattan by
Function getRealDist(this.tile, where.coord) mX = this\x - where\x mY = this\y - where\y mZ = this\z - where\z Return Sqr(mx*mx + my*my + mz*mz) End FunctionI confess I have not looked deeply at your code, but I guess that's what you want to achieve.
NB: I also removed this " * 1 " (!?!)