Fixed cGridStructGen.
Now cNetherFortGen works with the new architecture.
This commit is contained in:
parent
ccf44f18d1
commit
ee680990ba
@ -39,29 +39,17 @@ void cGridStructGen::GetStructuresForChunk(int a_ChunkX, int a_ChunkZ, cStructur
|
|||||||
int MinGridZ = MinBlockZ / m_GridSizeZ;
|
int MinGridZ = MinBlockZ / m_GridSizeZ;
|
||||||
int MaxGridX = (MaxBlockX + m_GridSizeX - 1) / m_GridSizeX;
|
int MaxGridX = (MaxBlockX + m_GridSizeX - 1) / m_GridSizeX;
|
||||||
int MaxGridZ = (MaxBlockZ + m_GridSizeZ - 1) / m_GridSizeZ;
|
int MaxGridZ = (MaxBlockZ + m_GridSizeZ - 1) / m_GridSizeZ;
|
||||||
if (MinBlockX < 0)
|
int MinX = MinGridX * m_GridSizeX;
|
||||||
{
|
int MaxX = MaxGridX * m_GridSizeX;
|
||||||
--MinGridX;
|
int MinZ = MinGridZ * m_GridSizeZ;
|
||||||
}
|
int MaxZ = MaxGridZ * m_GridSizeZ;
|
||||||
if (MinBlockZ < 0)
|
|
||||||
{
|
|
||||||
--MinGridZ;
|
|
||||||
}
|
|
||||||
if (MaxBlockX < 0)
|
|
||||||
{
|
|
||||||
--MaxGridX;
|
|
||||||
}
|
|
||||||
if (MaxBlockZ < 0)
|
|
||||||
{
|
|
||||||
--MaxGridZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Walk the cache, move each structure that we want into a_Structures:
|
// Walk the cache, move each structure that we want into a_Structures:
|
||||||
for (cStructurePtrs::iterator itr = m_Cache.begin(), end = m_Cache.end(); itr != end;)
|
for (cStructurePtrs::iterator itr = m_Cache.begin(), end = m_Cache.end(); itr != end;)
|
||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
((*itr)->m_OriginX >= MinBlockX) && ((*itr)->m_OriginX < MaxBlockX) &&
|
((*itr)->m_OriginX >= MinX) && ((*itr)->m_OriginX < MaxX) &&
|
||||||
((*itr)->m_OriginZ >= MinBlockZ) && ((*itr)->m_OriginZ < MaxBlockZ)
|
((*itr)->m_OriginZ >= MinZ) && ((*itr)->m_OriginZ < MaxZ)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// want
|
// want
|
||||||
|
Loading…
Reference in New Issue
Block a user