check for connectedness in mapgen
This commit is contained in:
		| @@ -168,7 +168,7 @@ export function generateMap(): LoadedNewMap { | ||||
|       if (e instanceof BadMapError) { | ||||
|         console.log(`Bad map generated: ${e.message}:`); | ||||
|         showDebug(e.badMap); | ||||
|         continue; | ||||
|         // continue; | ||||
|       } | ||||
|       throw e; | ||||
|     } | ||||
| @@ -604,6 +604,11 @@ function connectRegions(knife: Knife) { | ||||
|     connectors = connectors2; | ||||
|   } | ||||
|   knife.showDebug(merged); | ||||
|  | ||||
|   // The map should now be fully connected. | ||||
|   if (!knife.map.isConnected()) { | ||||
|     throw new BadMapError("unconnected", knife.map); | ||||
|   } | ||||
| } | ||||
|  | ||||
| function growMaze(knife: Knife, start: Point) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user