public static bool FindPoint(LogicTileMap tileMap, LogicVector2 pos1, LogicVector2 pos2, LogicVector2 pos3, LogicVector2 pos4) { pos1.Set(pos2.m_x, pos2.m_y); pos1.Substract(pos3); int length = pos1.GetLength(); pos1.m_x = (pos1.m_x << 7) / length; pos1.m_y = (pos1.m_y << 7) / length; pos4.Set(pos3.m_x, pos3.m_y); int radius = LogicMath.Clamp(length / 128, 10, 25); for (int i = 0; i < radius; i++) { if (tileMap.IsPassablePathFinder(pos4.m_x >> 8, pos4.m_y >> 8)) { pos4.m_x = (int)((pos4.m_x & 0xFFFFFF00) | 128); pos4.m_y = (int)((pos4.m_y & 0xFFFFFF00) | 128); return(true); } pos4.Add(pos1); } return(false); }