Added lowest layer to GameDate and Pathfinding. Fixed tile contentNode not being made visible.

This commit is contained in:
2026-05-09 10:07:16 +02:00
parent e00259cd31
commit 892365ff79
6 changed files with 6 additions and 8 deletions
+3 -3
View File
@@ -12,13 +12,13 @@ public class ExploreNode : ProgramNode
DisplayText = "Explore";
}
public override NodeResult Execute(Robot robot, double delta)
{
{
if (pathPoints == null)
{
int safetyCounter = 0;
while (true)
{
targetPosition = new Vector3I(GameData.rand.Next(GameData.layerSize), GameData.currentLayer, GameData.rand.Next(GameData.layerSize));
targetPosition = new Vector3I(GameData.rand.Next(GameData.layerSize), GameData.rand.Next(GameData.lowestLayer), GameData.rand.Next(GameData.layerSize));
if (!GameData.map[targetPosition.Y].tiles[targetPosition.X, targetPosition.Z].wasVisited) break;
safetyCounter++;
if (safetyCounter > Math.Pow(GameData.layerSize, 2) * 2)
@@ -33,7 +33,7 @@ public class ExploreNode : ProgramNode
if (pathPoints.Count <= 0)
{
lastExecutionMessage = "No path available";
lastExecutionMessage = $"No path available {targetPosition}";
return NodeResult.FAILURE;
}