From 36baaff11e117c623743dbd21dacd7bf571310c8 Mon Sep 17 00:00:00 2001 From: Cubitect Date: Mon, 12 Sep 2022 21:43:24 +0200 Subject: [PATCH] patch 2.4.1 fixed wrong nether portal variants for 1.17- fixed a crash when using nether or end biome filters with scale 1:4 fixed invalid warning when enabling reference exclusion with a radial area changed maximum scale limit, increasing it to 1:4096 --- cubiomes | 2 +- src/aboutdialog.h | 2 +- src/mapview.cpp | 2 +- src/search.cpp | 2 +- src/searchthread.cpp | 2 +- src/world.cpp | 29 ++++++++--------------------- 6 files changed, 13 insertions(+), 26 deletions(-) diff --git a/cubiomes b/cubiomes index 8b87d93..99a2e17 160000 --- a/cubiomes +++ b/cubiomes @@ -1 +1 @@ -Subproject commit 8b87d9379a3999ded2d575b0627c8771c15e93b2 +Subproject commit 99a2e1718e02393207e01808269aa4cb1bd27ff1 diff --git a/src/aboutdialog.h b/src/aboutdialog.h index 560befc..6cb3911 100644 --- a/src/aboutdialog.h +++ b/src/aboutdialog.h @@ -6,7 +6,7 @@ #define VERS_MAJOR 2 #define VERS_MINOR 4 -#define VERS_PATCH 0 // negative patch number designates a development version +#define VERS_PATCH 1 // negative patch number designates a development version // returns +1 if newer, -1 if older and 0 if equal inline int cmpVers(int major, int minor, int patch) diff --git a/src/mapview.cpp b/src/mapview.cpp index facce37..9d80ac9 100644 --- a/src/mapview.cpp +++ b/src/mapview.cpp @@ -314,7 +314,7 @@ void MapView::wheelEvent(QWheelEvent *e) { const qreal ang = e->angleDelta().y() / 8; // e->delta() / 8; blocks2pix *= pow(2, ang/100); - qreal scalemin = 128.0, scalemax = 1.0 / 1024.0; + qreal scalemin = 128.0, scalemax = 1.0 / 4096.0; if (blocks2pix > scalemin) blocks2pix = scalemin; if (blocks2pix < scalemax) blocks2pix = scalemax; update();//repaint(); diff --git a/src/search.cpp b/src/search.cpp index 25fa72e..95490f2 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -900,7 +900,7 @@ testCondAt( { StructureVariant vt; if (st == Ruined_Portal || st == Ruined_Portal_N) - id = getBiomeAt(&gen->g, 4, pc.x >> 2, 0, pc.z >> 2); + id = getBiomeAt(&gen->g, 4, (pc.x >> 2) + 2, 0, (pc.z >> 2) + 2); getVariant(&vt, st, gen->mc, gen->seed, pc.x, pc.z, id); if (!cond->isVariantOk(gen->mc, st, vt)) continue; diff --git a/src/searchthread.cpp b/src/searchthread.cpp index eea45f0..8c8526b 100644 --- a/src/searchthread.cpp +++ b/src/searchthread.cpp @@ -184,7 +184,7 @@ bool SearchMaster::set( return false; } } - if (c.skipref && c.x1 == 0 && c.x2 == 0 && c.z1 == 0 && c.z2 == 0) + if (c.skipref && c.rmax == 0 && c.x1 == 0 && c.x2 == 0 && c.z1 == 0 && c.z2 == 0) { QMessageBox::warning(parent, tr("Warning"), tr("Condition %1 ignores its only location of size 1.") diff --git a/src/world.cpp b/src/world.cpp index 9228c3e..cd72a7a 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -143,7 +143,7 @@ void getStructs(std::vector *out, const StructureConfig sconf, } else if (sconf.structType == Ruined_Portal || sconf.structType == Ruined_Portal_N) { - id = getBiomeAt(&g, 4, p.x >> 2, 0, p.z >> 2); + id = getBiomeAt(&g, 4, (p.x >> 2) + 2, 0, (p.z >> 2) + 2); } else if (sconf.structType == Fortress) { @@ -554,38 +554,25 @@ void QWorld::setDim(int dim, int layeropt) l.cells.swap(todel); } - int pixs; - if (g.mc >= MC_1_18) + int pixs, lcnt; + if (g.mc >= MC_1_18 || dim != DIM_OVERWORLD) { pixs = 128; + lcnt = 6; qual = 2.0; } else { pixs = 512; + lcnt = 5; qual = 1.0; } activelv = -1; lvb.clear(); - - if (dim == 0) - { - lvb.resize(5); - lvb[0].init4map(this, pixs, 1); - lvb[1].init4map(this, pixs, 4); - lvb[2].init4map(this, pixs, 16); - lvb[3].init4map(this, pixs, 64); - lvb[4].init4map(this, pixs, 256); - } - else - { - lvb.resize(4); - lvb[0].init4map(this, pixs, 1); - lvb[1].init4map(this, pixs, 4); - lvb[2].init4map(this, pixs, 16); - lvb[3].init4map(this, pixs, 64); - } + lvb.resize(lcnt); + for (int i = 0, scale = 1; i < lcnt; i++, scale *= 4) + lvb[i].init4map(this, pixs, scale); }