1
0
Fork 0

Fixed villages generating under-water.

The CompoGenBiomal didn't update the heightmap properly.
This commit is contained in:
Mattes D 2016-11-30 14:04:27 +01:00
parent 26a349b4f5
commit bb78bd88b5
2 changed files with 10 additions and 4 deletions

View File

@ -435,7 +435,12 @@ protected:
{
bool HasHadWater = false;
int PatternIdx = 0;
HEIGHTTYPE top = std::max(m_SeaLevel, a_ChunkDesc.GetHeight(a_RelX, a_RelZ));
HEIGHTTYPE top = a_ChunkDesc.GetHeight(a_RelX, a_RelZ);
if (top < m_SeaLevel)
{
top = m_SeaLevel;
a_ChunkDesc.SetHeight(a_RelX, a_RelZ, top - 1);
}
for (int y = top; y > 0; y--)
{
if (a_ShapeColumn[y] > 0)

View File

@ -234,13 +234,14 @@ protected:
{
for (int x = MinX; x <= MaxX; x++)
{
if (IsBlockWater(a_Chunk.GetBlockType(x, cChunkDef::GetHeight(a_HeightMap, x, z), z)))
auto height = cChunkDef::GetHeight(a_HeightMap, x, z);
if (IsBlockWater(a_Chunk.GetBlockType(x, height, z)))
{
a_Chunk.SetBlockTypeMeta(x, cChunkDef::GetHeight(a_HeightMap, x, z), z, WaterRoadBlockType, WaterRoadBlockMeta);
a_Chunk.SetBlockTypeMeta(x, height, z, WaterRoadBlockType, WaterRoadBlockMeta);
}
else
{
a_Chunk.SetBlockTypeMeta(x, cChunkDef::GetHeight(a_HeightMap, x, z), z, RoadBlockType, RoadBlockMeta);
a_Chunk.SetBlockTypeMeta(x, height, z, RoadBlockType, RoadBlockMeta);
}
}
}