From 5fa45182e87bc3c1b7d28ab74d914c93f9b6fbef Mon Sep 17 00:00:00 2001 From: 12xx12 <44411062+12xx12@users.noreply.github.com> Date: Fri, 5 Mar 2021 13:28:36 +0100 Subject: fixed the crash on generating in the SinglePiceStructuresGen (#5136) --- src/Generating/SinglePieceStructuresGen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Generating/SinglePieceStructuresGen.cpp') diff --git a/src/Generating/SinglePieceStructuresGen.cpp b/src/Generating/SinglePieceStructuresGen.cpp index bd079d762..84b246715 100644 --- a/src/Generating/SinglePieceStructuresGen.cpp +++ b/src/Generating/SinglePieceStructuresGen.cpp @@ -64,7 +64,8 @@ public: m_BiomeGen->GenBiomes({ChunkX, ChunkZ}, Biomes); // Checks if the biome at the origin position is allowed - if (!m_PiecePool.IsBiomeAllowed(Biomes[ChunkX + cChunkDef::Width * ChunkZ])) + auto Relative = cChunkDef::AbsoluteToRelative(Vector3i(a_OriginX, 1, a_OriginZ), {ChunkX, ChunkZ}); + if (!m_PiecePool.IsBiomeAllowed(Biomes[Relative.x + cChunkDef::Width * Relative.z])) { return cStructurePtr(); } -- cgit v1.2.3