diff options
author | Alexander Harkness <me@bearbin.net> | 2024-11-02 22:27:47 +0100 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2024-11-02 22:27:47 +0100 |
commit | cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a (patch) | |
tree | f647b20e1823f1846af88e832cf82a4a02e96e69 /src/Simulator/FluidSimulator.cpp | |
parent | Improve clang-format config file, remove automatically enforced code style from contrib guide. (diff) | |
download | cuberite-clang-format-codebase.tar cuberite-clang-format-codebase.tar.gz cuberite-clang-format-codebase.tar.bz2 cuberite-clang-format-codebase.tar.lz cuberite-clang-format-codebase.tar.xz cuberite-clang-format-codebase.tar.zst cuberite-clang-format-codebase.zip |
Diffstat (limited to 'src/Simulator/FluidSimulator.cpp')
-rw-r--r-- | src/Simulator/FluidSimulator.cpp | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/src/Simulator/FluidSimulator.cpp b/src/Simulator/FluidSimulator.cpp index 3771b0804..47dbe744b 100644 --- a/src/Simulator/FluidSimulator.cpp +++ b/src/Simulator/FluidSimulator.cpp @@ -8,9 +8,7 @@ cFluidSimulator::cFluidSimulator(cWorld & a_World, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid) : - Super(a_World), - m_FluidBlock(a_Fluid), - m_StationaryFluidBlock(a_StationaryFluid) + Super(a_World), m_FluidBlock(a_Fluid), m_StationaryFluidBlock(a_StationaryFluid) { } @@ -87,9 +85,7 @@ bool cFluidSimulator::IsSolidBlock(BLOCKTYPE a_BlockType) bool cFluidSimulator::IsPassableForFluid(BLOCKTYPE a_BlockType) { return ( - (a_BlockType == E_BLOCK_AIR) || - (a_BlockType == E_BLOCK_FIRE) || - IsAllowedBlock(a_BlockType) || + (a_BlockType == E_BLOCK_AIR) || (a_BlockType == E_BLOCK_FIRE) || IsAllowedBlock(a_BlockType) || CanWashAway(a_BlockType) ); } @@ -143,25 +139,17 @@ Vector3f cFluidSimulator::GetFlowingDirection(Vector3i a_Pos) } const auto HeightFromMeta = [](NIBBLETYPE a_BlockMeta) -> NIBBLETYPE - { - // Falling water blocks are always full height (0) - return ((a_BlockMeta & 0x08) != 0) ? 0 : a_BlockMeta; - }; + { + // Falling water blocks are always full height (0) + return ((a_BlockMeta & 0x08) != 0) ? 0 : a_BlockMeta; + }; auto BlockMeta = m_World.GetBlockMeta(a_Pos); NIBBLETYPE CentralPoint = HeightFromMeta(BlockMeta); NIBBLETYPE LevelPoint[4]; // blocks around the checking pos - std::array<Vector3i, 4> Offsets - { - { - { 1, 0, 0 }, - { 0, 0, 1 }, - { 1, 0, 0 }, - { 0, 0, 1 } - } - }; + std::array<Vector3i, 4> Offsets {{{1, 0, 0}, {0, 0, 1}, {1, 0, 0}, {0, 0, 1}}}; for (size_t i = 0; i < Offsets.size(); i++) { @@ -189,4 +177,3 @@ Vector3f cFluidSimulator::GetFlowingDirection(Vector3i a_Pos) return Direction; } - |