summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-24 22:52:01 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-24 22:52:01 +0200
commitacbd4e6503a8da6645c97dbe010eed7f37386194 (patch)
tree05571f05c451eb32b22d4a9b723f396248d37fca
parentImplemented suggestions (diff)
downloadcuberite-acbd4e6503a8da6645c97dbe010eed7f37386194.tar
cuberite-acbd4e6503a8da6645c97dbe010eed7f37386194.tar.gz
cuberite-acbd4e6503a8da6645c97dbe010eed7f37386194.tar.bz2
cuberite-acbd4e6503a8da6645c97dbe010eed7f37386194.tar.lz
cuberite-acbd4e6503a8da6645c97dbe010eed7f37386194.tar.xz
cuberite-acbd4e6503a8da6645c97dbe010eed7f37386194.tar.zst
cuberite-acbd4e6503a8da6645c97dbe010eed7f37386194.zip
Diffstat (limited to '')
-rw-r--r--src/Chunk.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 6c35f7f47..7af1820d2 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -378,24 +378,14 @@ void cChunk::SetLight(
// TODO: We might get cases of wrong lighting when a chunk changes in the middle of a lighting calculation.
// Postponing until we see how bad it is :)
- int IdxWhereNonEmptyStarts = 0;
{ // Compress blocklight
m_BlockLight.clear();
-
- for (int Idx = (NumBlocks / 2) - 1; Idx >= 0; Idx--)
- {
- if (a_BlockLight[Idx] != 0)
- {
- IdxWhereNonEmptyStarts = Idx;
- break;
- }
- }
- m_BlockLight.insert(m_BlockLight.end(), &a_BlockLight[0], &a_BlockLight[IdxWhereNonEmptyStarts + 1]);
+ m_BlockLight.insert(m_BlockLight.end(), &a_BlockLight[0], &a_BlockLight[m_BlockTypes.size()]);
}
{ // Compress skylight
m_BlockSkyLight.clear();
- m_BlockSkyLight.insert(m_BlockSkyLight.end(), &a_SkyLight[0], &a_SkyLight[IdxWhereNonEmptyStarts + 1]);
+ m_BlockSkyLight.insert(m_BlockSkyLight.end(), &a_SkyLight[0], &a_SkyLight[m_BlockTypes.size()]);
}
m_IsLightValid = true;