it fricken works!
This commit is contained in:
@@ -72,19 +72,20 @@ namespace PathFinding
|
||||
foreach (var path in element.GetPaths())
|
||||
{
|
||||
var shouldPath = true;
|
||||
var next = Vector2.Add(from, path.Direction);
|
||||
var next = Vector2.Add(from, path.Direction); ;
|
||||
while (shouldPath && next.X < width && next.Y < height && next.X >= 0 && next.Y >= 0)
|
||||
{
|
||||
var collider = collection[(int)next.X, (int)next.Y];
|
||||
if (collider != null)
|
||||
{
|
||||
callback(collider, next);
|
||||
shouldPath = false;
|
||||
}
|
||||
next = Vector2.Add(from, path.Direction);
|
||||
if (path.Distance == Distance.OneStep)
|
||||
{
|
||||
shouldPath = false;
|
||||
}
|
||||
next = Vector2.Add(next, path.Direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user