diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-10-05 14:09:42 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-12-18 22:03:40 +0100 |
commit | 090d8305e4e3c3ee085a897b72f2b4708e183eb8 (patch) | |
tree | e703cc7fcb7f16c85f16b094d5df0bd0a8d698e8 /src/Chunk.cpp | |
parent | Horsies: don't always broadcast metadata (diff) | |
download | cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.gz cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.bz2 cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.lz cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.xz cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.zst cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.zip |
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r-- | src/Chunk.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 663713cf3..7bf7f0567 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -479,8 +479,15 @@ bool cChunk::HasBlockEntityAt(Vector3i a_BlockPos) void cChunk::Stay(bool a_Stay) { - m_StayCount += (a_Stay ? 1 : -1); - ASSERT(m_StayCount >= 0); + if (a_Stay) + { + m_StayCount++; + } + else + { + ASSERT(m_StayCount != 0); + m_StayCount--; + } } |