summaryrefslogtreecommitdiffstats
path: root/source/cChunk.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-18 18:53:22 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-18 18:53:22 +0100
commit499745c1c7a865941b3c102532777c19dfb92ca4 (patch)
treedeccb8ffdafe6dbb85e8e630eaca0a6e5a66c5ed /source/cChunk.cpp
parentLogging: added thread ID to the log output in debug builds (diff)
downloadcuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar.gz
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar.bz2
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar.lz
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar.xz
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.tar.zst
cuberite-499745c1c7a865941b3c102532777c19dfb92ca4.zip
Diffstat (limited to '')
-rw-r--r--source/cChunk.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp
index 5bd6ca1e9..b5e56f3c6 100644
--- a/source/cChunk.cpp
+++ b/source/cChunk.cpp
@@ -109,6 +109,8 @@ void cChunk::SetValid(bool a_SendToClients)
{
m_IsValid = true;
+ m_World->GetChunkMap()->ChunkValidated();
+
if (!a_SendToClients)
{
return;
@@ -177,7 +179,7 @@ void cChunk::MarkSaved(void)
void cChunk::MarkLoaded(void)
{
m_IsDirty = false;
- m_IsValid = true;
+ SetValid();
}
@@ -240,8 +242,6 @@ void cChunk::SetAllData(const char * a_BlockData, cEntityList & a_Entities, cBlo
CreateBlockEntities();
CalculateHeightmap();
-
- MarkDirty();
}
@@ -511,7 +511,7 @@ void cChunk::Tick(float a_Dt, MTRand & a_TickRandom)
-char cChunk::GetHeight( int a_X, int a_Z )
+int cChunk::GetHeight( int a_X, int a_Z )
{
if( a_X >= 0 && a_X < 16 && a_Z >= 0 && a_Z < 16 )
{
@@ -756,10 +756,10 @@ void cChunk::SpreadLight(char* a_LightBuffer)
}
}
- if( bCalcLeft ) m_World->ReSpreadLighting( LeftChunk );
- if( bCalcRight ) m_World->ReSpreadLighting( RightChunk );
- if( bCalcFront ) m_World->ReSpreadLighting( FrontChunk );
- if( bCalcBack ) m_World->ReSpreadLighting( BackChunk );
+ if( bCalcLeft ) m_World->ReSpreadLighting( m_PosX - 1, m_PosY, m_PosZ );
+ if( bCalcRight ) m_World->ReSpreadLighting( m_PosX + 1, m_PosY, m_PosZ );
+ if( bCalcFront ) m_World->ReSpreadLighting( m_PosX, m_PosY, m_PosZ - 1 );
+ if( bCalcBack ) m_World->ReSpreadLighting( m_PosX, m_PosY, m_PosZ + 1 );
}