From 090d8305e4e3c3ee085a897b72f2b4708e183eb8 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 5 Oct 2020 13:09:42 +0100 Subject: Warnings improvements * Turn off global-constructors warning. These are needed to implement cRoot signal handler functionality * Add Clang flags based on version lookup instead of a compile test. The CMake config process is single threaded and slow enough already * Reduced GetStackValue verbosity + Clarify EnchantmentLevel, StayCount, AlwaysTicked, ViewDistance signedness + Give SettingsRepositoryInterface a move constructor to simplify main.cpp code - Remove do {} while (false) construction in redstone handler --- src/Chunk.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Chunk.cpp') 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--; + } } -- cgit v1.2.3