diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-16 18:45:26 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-02-16 18:45:26 +0100 |
commit | 2928cb6853f1e007e98f174c37d75c793a0c09cc (patch) | |
tree | 25865a247f5460f185f7f058e0db54637b487a5d /source/cChunk.cpp | |
parent | Got rid of dangerous GetEntity(), not using DoWithEntity() (diff) | |
download | cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar.gz cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar.bz2 cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar.lz cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar.xz cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.tar.zst cuberite-2928cb6853f1e007e98f174c37d75c793a0c09cc.zip |
Diffstat (limited to '')
-rw-r--r-- | source/cChunk.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/cChunk.cpp b/source/cChunk.cpp index 5ebf8b656..5bd6ca1e9 100644 --- a/source/cChunk.cpp +++ b/source/cChunk.cpp @@ -805,8 +805,6 @@ void cChunk::SetBlock( int a_X, int a_Y, int a_Z, char a_BlockType, char a_Block assert(IsValid()); // Is this chunk loaded / generated?
- MarkDirty();
-
int index = a_Y + (a_Z * 128) + (a_X * 128 * 16);
char OldBlockMeta = GetLight( m_BlockMeta, index );
char OldBlockType = m_BlockType[index];
@@ -819,6 +817,8 @@ void cChunk::SetBlock( int a_X, int a_Y, int a_Z, char a_BlockType, char a_Block return;
}
+ MarkDirty();
+
cCSLock Lock(m_CSBlockLists);
m_PendingSendBlocks.push_back( index );
@@ -871,14 +871,15 @@ void cChunk::FastSetBlock( int a_X, int a_Y, int a_Z, char a_BlockType, char a_B assert(IsValid());
- MarkDirty();
-
const int index = a_Y + (a_Z * 128) + (a_X * 128 * 16);
const char OldBlock = m_BlockType[index];
if (OldBlock == a_BlockType)
{
return;
}
+
+ MarkDirty();
+
m_BlockType[index] = a_BlockType;
{
@@ -1107,7 +1108,7 @@ bool cChunk::HasClient( cClientHandle* a_Client ) -bool cChunk::HasAnyClient(void)
+bool cChunk::HasAnyClients(void)
{
cCSLock Lock(m_CSClients);
return !m_LoadedByClient.empty();
|