1
0

fixed the crash on generating in the SinglePiceStructuresGen (#5136)

This commit is contained in:
12xx12
2021-03-05 13:28:36 +01:00
committed by GitHub
parent 81e299f00c
commit 5fa45182e8

View File

@@ -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();
}