This commit is contained in:
MarcEricMartel 2021-11-26 12:00:05 -05:00
parent fe624fdafc
commit 1520ade4f0

View File

@ -28,15 +28,15 @@ void Chunk::CheckNeighbors(int x, int z, World* world) {
world->ChunkAt((m_posX - 1) * CHUNK_SIZE_X, 1, m_posY * CHUNK_SIZE_Z)) world->ChunkAt((m_posX - 1) * CHUNK_SIZE_X, 1, m_posY * CHUNK_SIZE_Z))
world->ChunkAt((m_posX - 1) * CHUNK_SIZE_X, 1, m_posY * CHUNK_SIZE_Z)->MakeDirty(); world->ChunkAt((m_posX - 1) * CHUNK_SIZE_X, 1, m_posY * CHUNK_SIZE_Z)->MakeDirty();
else if (x == CHUNK_SIZE_X - 1 && m_posX < WORLD_SIZE_X && else if (x == CHUNK_SIZE_X - 1 && m_posX < WORLD_SIZE_X &&
world->ChunkAt((m_posX + 1) * CHUNK_SIZE_X - 1, 1, m_posY * CHUNK_SIZE_Z)) world->ChunkAt((m_posX + 1) * CHUNK_SIZE_X, 1, m_posY * CHUNK_SIZE_Z))
world->ChunkAt((m_posX + 1) * CHUNK_SIZE_X - 1, 1, m_posY * CHUNK_SIZE_Z)->MakeDirty(); world->ChunkAt((m_posX + 1) * CHUNK_SIZE_X, 1, m_posY * CHUNK_SIZE_Z)->MakeDirty();
if (z == 0 && m_posY >= 0 && if (z == 0 && m_posY >= 0 &&
world->ChunkAt(m_posX * CHUNK_SIZE_X, 1, (m_posY - 1) * CHUNK_SIZE_Z)) world->ChunkAt(m_posX * CHUNK_SIZE_X, 1, (m_posY - 1) * CHUNK_SIZE_Z))
world->ChunkAt(m_posX * CHUNK_SIZE_X, 1, (m_posY - 1) * CHUNK_SIZE_Z)->MakeDirty(); world->ChunkAt(m_posX * CHUNK_SIZE_X, 1, (m_posY - 1) * CHUNK_SIZE_Z)->MakeDirty();
else if (z == CHUNK_SIZE_X - 1 && m_posY < WORLD_SIZE_Y && else if (z == CHUNK_SIZE_X - 1 && m_posY < WORLD_SIZE_Y &&
world->ChunkAt(m_posX * CHUNK_SIZE_X, 1, (m_posY + 1) * CHUNK_SIZE_Z - 1)) world->ChunkAt(m_posX * CHUNK_SIZE_X, 1, (m_posY + 1) * CHUNK_SIZE_Z))
world->ChunkAt(m_posX * CHUNK_SIZE_X, 1, (m_posY + 1) * CHUNK_SIZE_Z - 1)->MakeDirty(); world->ChunkAt(m_posX * CHUNK_SIZE_X, 1, (m_posY + 1) * CHUNK_SIZE_Z)->MakeDirty();
} }
int Chunk::GetPosX() const { return m_posX; } int Chunk::GetPosX() const { return m_posX; }