correction

This commit is contained in:
MarcEricMartel 2023-11-13 16:46:03 -05:00
parent 80a5bf90b4
commit c98625a610

View File

@ -39,14 +39,22 @@ void World::RemoveChunk(int nbReduit)
for (int x = 0; x < WORLD_SIZE_X; ++x) for (int x = 0; x < WORLD_SIZE_X; ++x)
for (int y = 0; y < WORLD_SIZE_Y; ++y) for (int y = 0; y < WORLD_SIZE_Y; ++y)
{ {
Chunk* chk = nullptr;
if (x < nbReduit) if (x < nbReduit)
m_chunks.Remove(x,y); chk = m_chunks.Remove(x, y);
if (y < nbReduit) if (y < nbReduit)
m_chunks.Remove(x, y); chk = m_chunks.Remove(x, y);
if (y > WORLD_SIZE_Y - nbReduit) if (y > WORLD_SIZE_Y - nbReduit)
m_chunks.Remove(x, y); chk = m_chunks.Remove(x, y);
if (x > WORLD_SIZE_X - nbReduit) if (x > WORLD_SIZE_X - nbReduit)
m_chunks.Remove(x, y); chk = m_chunks.Remove(x, y);
// TODO: MakeDirty() les voisins pour qu'ils se redessinent.
if (!chk)
continue;
m_tbDeleted.emplace_back(chk);
} }