i think i should know more about c++ before editting the server more
i now have this:
i now have this:
Quote:void cFinishGenLilypad::GenFinish(
int a_ChunkX, int a_ChunkZ,
cChunkDef::BlockTypes & a_BlockTypes, // Block types to read and change
cChunkDef::BlockNibbles & a_BlockMeta, // Block meta to read and change
cChunkDef::HeightMap & a_HeightMap, // Height map to read and change by the current data
const cChunkDef::BiomeMap & a_BiomeMap, // Biomes to adhere to
cEntityList & a_Entities, // Entities may be added or deleted
cBlockEntityList & a_BlockEntities // Block entities may be added or deleted
)
;{
// Turn surface water into Lilypads in Swampland
int NumLilyPads = GetNumLilyPads(a_BiomeMap);
for (int i = 0; i < NumLilyPads; i++)
{
int x = m_Noise.IntNoise3DInt(a_ChunkX + a_ChunkZ, a_ChunkZ, i) % cChunkDef::Width;
int z = m_Noise.IntNoise3DInt(a_ChunkX - a_ChunkZ, i, a_ChunkZ) % cChunkDef::Width;
// Place lilypad at {x, z} if possible (empty block, water below)
{
{
if (biSwampland)
{
{
int Height = cChunkDef::GetHeight(a_HeightMap, x, z);
switch (cChunkDef::GetBlock(a_BlockTypes, x, Height, z))
{
case E_BLOCK_WATER:
case E_BLOCK_STATIONARY_WATER:
{
cChunkDef::SetBlock(a_BlockTypes, x, Height + 1, z, E_BLOCK_LILY_PAD);
cChunkDef::SetHeight(a_HeightMap, x, z, Height + 1);
break;
for (int z = 0; z < cChunkDef::Width; z++)
{
for (int x = 0; x < cChunkDef::Width; x++)
{
case biSwampland:
{
{
int Height = cChunkDef::GetHeight(a_HeightMap, x, z);
{
if (E_BLOCK_WATER)
{
if (E_BLOCK_STATIONARY_WATER)
{
cChunkDef::SetBlock(a_BlockTypes, x, Height + 1, z, E_BLOCK_LILY_PAD);
cChunkDef::SetHeight(a_HeightMap, x, z, Height + 1);
break;
}
}
}
break;
}
}
}
// for z
}
}
}
}
}
}
}
}
}