diff --git a/src/mapgen/mapgen_v6.cpp b/src/mapgen/mapgen_v6.cpp index 2b4d37c6bd..a56ce24ea0 100644 --- a/src/mapgen/mapgen_v6.cpp +++ b/src/mapgen/mapgen_v6.cpp @@ -43,6 +43,18 @@ const FlagDesc flagdesc_mapgen_v6[] = { MapgenV6::MapgenV6(MapgenV6Params *params, EmergeParams *emerge) : Mapgen(MAPGEN_V6, params, emerge) { + if (csize.X != csize.Y || csize.Y != csize.Z) { + // In practice: + // (5,2,1) segfaults in mudflow + // (5,2,5) generates very broken terrain + throw BaseException("MapgenV6: chunk size must be cubic"); + } + if (csize.Y % 2 == 0) { + // weird ledges appear in some places + warningstream << "MapgenV6: chunk heights divisible by two are known " + "to be buggy." << std::endl; + } + ystride = csize.X; heightmap = new s16[csize.X * csize.Z]; diff --git a/src/mapgen/mg_decoration.cpp b/src/mapgen/mg_decoration.cpp index 1e3b7ec53d..600de1446d 100644 --- a/src/mapgen/mg_decoration.cpp +++ b/src/mapgen/mg_decoration.cpp @@ -132,6 +132,10 @@ void Decoration::placeDeco(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax) PcgRandom ps(blockseed + 53); int carea_size = nmax.X - nmin.X + 1; + if (nmax.Z - nmin.Z + 1 != carea_size) { + // TODO: this is a stupid restriction, which we should lift + throw BaseException("Decoration::placeDeco requires a square area (XZ)"); + } // Divide area into parts // If chunksize is changed it may no longer be divisable by sidelen