Added lowest layer to GameDate and Pathfinding. Fixed tile contentNode not being made visible.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user