Ceremonial PR: fix map gen #39
| @@ -168,7 +168,7 @@ export function generateMap(): LoadedNewMap { | |||||||
|       if (e instanceof BadMapError) { |       if (e instanceof BadMapError) { | ||||||
|         console.log(`Bad map generated: ${e.message}:`); |         console.log(`Bad map generated: ${e.message}:`); | ||||||
|         showDebug(e.badMap); |         showDebug(e.badMap); | ||||||
|         continue; |         // continue; | ||||||
|       } |       } | ||||||
|       throw e; |       throw e; | ||||||
|     } |     } | ||||||
| @@ -604,6 +604,11 @@ function connectRegions(knife: Knife) { | |||||||
|     connectors = connectors2; |     connectors = connectors2; | ||||||
|   } |   } | ||||||
|   knife.showDebug(merged); |   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) { | function growMaze(knife: Knife, start: Point) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user