Browse Source

And a few more that I just realised should be there.

master
s3607057 (Angus Niven) 5 years ago
parent
commit
d97f9b40b8
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      Assets/Scripts/Map Generation/MapManager.cs

+ 4
- 1
Assets/Scripts/Map Generation/MapManager.cs View File

@ -192,21 +192,24 @@ public class MapManager : ScriptableObject
bool checkSegments(MapSection first, MapSection second) bool checkSegments(MapSection first, MapSection second)
{ {
Debug.Log("Checking " + first.name + " & " + second.name);
Debug.Log("Checking " + first.name + " & " + second.name + ". DiffMin = " + second.difficultyMin + ", DiffMax = " + second.difficultyMax);
int connections = 0; int connections = 0;
//No more than one link section in a row //No more than one link section in a row
if (first.length == 1 && second.length == 1) if (first.length == 1 && second.length == 1)
{ {
Debug.Log("Disqualified: repeated link sections");
return false; return false;
} }
if (second.difficultyMax < difficulty || second.difficultyMin > difficulty) //Check that we're in the right difficulty range for this section if (second.difficultyMax < difficulty || second.difficultyMin > difficulty) //Check that we're in the right difficulty range for this section
{ {
Debug.Log("Disqualified: wrong difficulty");
return false; return false;
} }
if (second.widthIn < widthMin || second.widthIn > widthMax) //And that it's in the right width range if (second.widthIn < widthMin || second.widthIn > widthMax) //And that it's in the right width range
{ {
Debug.Log("Disqualified: wrong width");
return false; return false;
} }

Loading…
Cancel
Save