geometry: bordermesh: make sure we can still do travel even if a mesh cannot be generated

This commit is contained in:
Torrie Fischer 2021-06-14 13:24:51 -07:00
parent 7e78af38c9
commit 817b6c823a

View File

@ -113,7 +113,16 @@ public class BorderMesh {
log.warning("Got a null pointer when triangulating, skipping world."); log.warning("Got a null pointer when triangulating, skipping world.");
return false; return false;
} catch (NotEnoughPointsException e) { } catch (NotEnoughPointsException e) {
log.info("Not enough points to triangulate mesh. Add more regions!"); log.info("Not enough points to triangulate mesh, all regions will be connected to each other. Add more regions!");
for(Region region : m_regions) {
HashSet<Region> neighbors = new HashSet<Region>();
for(Region neighbor : m_regions) {
if (neighbor != region) {
neighbors.add(neighbor);
}
}
m_neighbors.put(region, neighbors);
}
return false; return false;
} }