1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-21 07:44:07 +00:00

ls:: firstland now taken into account in Voronoi

This commit is contained in:
Zeno Rogue 2023-09-14 16:20:51 +02:00
parent 8ac3bb29ab
commit f9b8551529

View File

@ -219,7 +219,7 @@ void hrmap::extend_altmap(heptagon *h, int levs, bool link_cdata) {
} }
} }
void new_voronoi_root(heptagon *h, int dist, int dir, eLand last, eLand last2) { void new_voronoi_root(heptagon *h, int dist, int dir, eLand next, eLand last) {
heptagon *alt = init_heptagon(h->type); heptagon *alt = init_heptagon(h->type);
allmaps.push_back(newAltMap(alt)); allmaps.push_back(newAltMap(alt));
alt->s = hsA; alt->s = hsA;
@ -229,7 +229,7 @@ void new_voronoi_root(heptagon *h, int dist, int dir, eLand last, eLand last2) {
h->alt = alt; h->alt = alt;
altmap::relspin(alt) = dir; altmap::relspin(alt) = dir;
horodisk_land[alt] = getNewLand(last, last2); horodisk_land[alt] = next;
horodisk_last_land[alt] = last; horodisk_last_land[alt] = last;
while(alt->distance > -100) { while(alt->distance > -100) {
@ -291,7 +291,7 @@ void extend_altmap_voronoi(heptagon *h) {
auto ci = voronoi_candidate(h); auto ci = voronoi_candidate(h);
if(ci.bqty == 0) { if(ci.bqty == 0) {
new_voronoi_root(h, -30, hrand(h->type), laBarrier, laBarrier); new_voronoi_root(h, -30, hrand(h->type), firstland, laBarrier);
return; return;
} }
else if(ci.bqty > 0 && isize(ci.free_dirs)) { else if(ci.bqty > 0 && isize(ci.free_dirs)) {
@ -299,7 +299,9 @@ void extend_altmap_voronoi(heptagon *h) {
ld growth = expansion.get_growth(); ld growth = expansion.get_growth();
ld odds = pow(growth, ci.candidate->distance) * isize(ci.free_dirs); ld odds = pow(growth, ci.candidate->distance) * isize(ci.free_dirs);
if(hrandf() < odds / (1 + odds)) { if(hrandf() < odds / (1 + odds)) {
new_voronoi_root(h, ci.candidate->distance - 1, hrand_elt(ci.free_dirs), horodisk_land[ci.candidate->alt], horodisk_last_land[ci.candidate->alt]); eLand last = horodisk_land[ci.candidate->alt];
eLand last2 = horodisk_last_land[ci.candidate->alt];
new_voronoi_root(h, ci.candidate->distance - 1, hrand_elt(ci.free_dirs), getNewLand(last, last2), last);
return; return;
} }
} }