cleared up issue with pathing, but still an issue with attacks?

This commit is contained in:
2026-06-26 02:52:08 -04:00
parent 350d2bc4d1
commit 2529d01ff4
2 changed files with 9 additions and 12 deletions
+6 -9
View File
@@ -57,18 +57,14 @@ public partial class Peg : HoverableNode
{
Map map = _pegController._playArea._map;
List<Vector2I> goals = GetGoals();
List<List<Vector2I>> paths = new();
List<Vector2I> bestPath = map.GetPath(_address, goals[0]);
for (int i = 1; i < goals.Count; i++)
for (int i = 0; i < goals.Count; i++)
{
Vector2I testGoal = goals[i];
List<Vector2I> testPath = map.GetPath(_address, testGoal);
if (testPath.Count < bestPath.Count)
{
bestPath = testPath;
}
paths.Add(map.GetPath(_address, goals[i]));
}
return bestPath;
return paths.Where(p => p.Count > 0).OrderBy(p => p.Count).ToList()[0];
}
public virtual List<Vector2I> GetGoals()
@@ -99,6 +95,7 @@ public partial class Peg : HoverableNode
{
_staminaRemaining = _stamina;
_action._usesRemaining = _action._usesMax;
GD.Print("ACTION ",_action._usesRemaining,", ",_action._usesRemaining);
}
public virtual void ChangeHealth(int DELTA, Commander BALLER)