Skip to content

Commit

Permalink
Fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellri committed Sep 22, 2019
1 parent b51dd19 commit 42f4a65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion unity-tilemap-generator/Assets/Scripts/RiverGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ public void GenerateRiversByHeight(TerrainGenerator terrainGenerator, int minSou
int maxLevel = levelNodes.Keys.Max(),
currentLevel,
lastObsticalLength = obsticals.Count;

if (maxLevel < minSourceLevel || !levelNodes.ContainsKey(destinationLevel)) return;

List<uint> nodeList;
uint source, destination;
Vector3Int currentVector;
Expand Down Expand Up @@ -143,7 +146,6 @@ public bool GenerateRiver(TerrainGenerator terrainGenerator, uint source, uint d
terrainGenerator.Graph[(uint)multiPathDestination].Item
: terrainGenerator.Graph[destination].Item;
int terrainZ;
//var path = terrainGenerator.Graph.Dijkstra(source, destination/*, (int)waterVector.magnitude*/);
var path = terrainGenerator.Graph.AStar(source, destination, heuristic);
foreach (var node in path.GetPath())
{
Expand Down

0 comments on commit 42f4a65

Please sign in to comment.