1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-17 10:44:48 +00:00

ls:: in voronoi, eliminate bugs when new root goes through known area

This commit is contained in:
Zeno Rogue 2023-09-14 17:25:55 +02:00
parent 283fe020fc
commit 2668841e5a

View File

@ -226,7 +226,8 @@ void new_voronoi_root(heptagon *h, int dist, int dir, eLand next, eLand last) {
alt->alt = alt;
alt->cdata = (cdata*) h;
alt->distance = dist;
h->alt = alt;
vector<pair<heptagon*, heptagon*>> altpairs;
altpairs.emplace_back(h, alt);
altmap::relspin(alt) = dir;
horodisk_land[alt] = next;
@ -236,6 +237,8 @@ void new_voronoi_root(heptagon *h, int dist, int dir, eLand next, eLand last) {
auto alt1 = createStep(alt, 0);
alt1->alt = alt->alt;
auto h1 = createStep(h, dir);
if(h1->alt) return;
altpairs.emplace_back(h1, alt1);
h1->alt = alt1;
auto dir_alt = alt->c.spin(0);
@ -245,8 +248,11 @@ void new_voronoi_root(heptagon *h, int dist, int dir, eLand next, eLand last) {
h = h1; alt = alt1;
}
for(auto p: altpairs) p.first->alt = p.second;
}
struct cand_info {
int best, bqty;
heptagon *candidate;