diff options
author | Mattes D <github@xoft.cz> | 2016-08-25 09:04:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-25 09:04:17 +0200 |
commit | d52afadad491474f63e8184cb5a08c0ca21ab48c (patch) | |
tree | d5afab6035ca6bb0b58fd03ad5cfe3b3f8e1da55 /src/Simulator | |
parent | Merge pull request #3342 from cuberite/FixEmptyHeader (diff) | |
parent | Fixed type-casting-related warnings. (diff) | |
download | cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.gz cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.bz2 cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.lz cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.xz cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.tar.zst cuberite-d52afadad491474f63e8184cb5a08c0ca21ab48c.zip |
Diffstat (limited to 'src/Simulator')
-rw-r--r-- | src/Simulator/CMakeLists.txt | 11 | ||||
-rw-r--r-- | src/Simulator/FluidSimulator.cpp | 12 |
2 files changed, 10 insertions, 13 deletions
diff --git a/src/Simulator/CMakeLists.txt b/src/Simulator/CMakeLists.txt index dcd099890..45972a6ef 100644 --- a/src/Simulator/CMakeLists.txt +++ b/src/Simulator/CMakeLists.txt @@ -11,7 +11,8 @@ SET (SRCS Simulator.cpp SimulatorManager.cpp VanillaFluidSimulator.cpp - VaporizeFluidSimulator.cpp) + VaporizeFluidSimulator.cpp +) SET (HDRS DelayedFluidSimulator.h @@ -25,14 +26,10 @@ SET (HDRS Simulator.h SimulatorManager.h VanillaFluidSimulator.h - VaporizeFluidSimulator.h) + VaporizeFluidSimulator.h +) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set_source_files_properties(FireSimulator.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion") - set_source_files_properties(FluidSimulator.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=sign-conversion -Wno-error=shadow") -endif() - if(NOT MSVC) add_library(Simulator ${SRCS} ${HDRS}) endif() diff --git a/src/Simulator/FluidSimulator.cpp b/src/Simulator/FluidSimulator.cpp index 10e4fee21..fce5e64b9 100644 --- a/src/Simulator/FluidSimulator.cpp +++ b/src/Simulator/FluidSimulator.cpp @@ -120,7 +120,7 @@ bool cFluidSimulator::IsHigherMeta(NIBBLETYPE a_Meta1, NIBBLETYPE a_Meta2) // TODO Not working very well yet :s Direction cFluidSimulator::GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a_Over) { - if ((a_Y < 0) || (a_Y >= cChunkDef::Height)) + if (!cChunkDef::IsValidHeight(a_Y)) { return NONE; } @@ -157,11 +157,11 @@ Direction cFluidSimulator::GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a Points.push_back(new Vector3i(a_X, a_Y, a_Z + 1)); Points.push_back(new Vector3i(a_X, a_Y, a_Z - 1)); - for (std::vector<Vector3i *>::iterator it = Points.begin(); it < Points.end(); ++it) + for (auto itr = Points.cbegin(), end = Points.cend(); itr != end; ++itr) { - Vector3i *Pos = (*it); - BLOCKTYPE BlockID = m_World.GetBlock(Pos->x, Pos->y, Pos->z); - if (IsAllowedBlock(BlockID)) + Vector3i * Pos = (*itr); + auto PosBlockID = m_World.GetBlock(Pos->x, Pos->y, Pos->z); + if (IsAllowedBlock(PosBlockID)) { NIBBLETYPE Meta = m_World.GetBlockMeta(Pos->x, Pos->y, Pos->z); @@ -172,7 +172,7 @@ Direction cFluidSimulator::GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a Z = Pos->z; } } - else if (BlockID == E_BLOCK_AIR) + else if (PosBlockID == E_BLOCK_AIR) { LowestPoint = 9; // This always dominates X = Pos->x; |