From f8881622a4000d769af700396f772bae21d1d117 Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 3 Feb 2014 12:31:18 -0800 Subject: Removed unused lookups --- src/Simulator/FluidSimulator.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/Simulator') diff --git a/src/Simulator/FluidSimulator.cpp b/src/Simulator/FluidSimulator.cpp index 72b2eb628..61c93ed73 100644 --- a/src/Simulator/FluidSimulator.cpp +++ b/src/Simulator/FluidSimulator.cpp @@ -166,14 +166,12 @@ Direction cFluidSimulator::GetFlowingDirection(int a_X, int a_Y, int a_Z, bool a { LowestPoint = Meta; X = Pos->x; - Pos->y; //Remove if no side effects Z = Pos->z; } }else if(BlockID == E_BLOCK_AIR) { LowestPoint = 9; //This always dominates X = Pos->x; - Pos->y; //Remove if no side effects Z = Pos->z; } -- cgit v1.2.3 From 8464f689ea214d3c30105ae58539885cf1268317 Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 4 Feb 2014 10:59:05 -0800 Subject: Improved Type safety of eBlockFace May Fix #640 --- src/Simulator/RedstoneSimulator.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Simulator') diff --git a/src/Simulator/RedstoneSimulator.cpp b/src/Simulator/RedstoneSimulator.cpp index 05badf0d4..6b7ae3196 100644 --- a/src/Simulator/RedstoneSimulator.cpp +++ b/src/Simulator/RedstoneSimulator.cpp @@ -1112,12 +1112,13 @@ bool cRedstoneSimulator::IsPistonPowered(int a_BlockX, int a_BlockY, int a_Block // Pistons cannot be powered through their front face; this function verifies that a source meets this requirement int OldX = a_BlockX, OldY = a_BlockY, OldZ = a_BlockZ; + eBlockFace Face = cPiston::MetaDataToDirection(a_Meta); for (PoweredBlocksList::const_iterator itr = m_PoweredBlocks.begin(); itr != m_PoweredBlocks.end(); ++itr) { if (!itr->a_BlockPos.Equals(Vector3i(a_BlockX, a_BlockY, a_BlockZ))) { continue; } - AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_Meta); // Piston meta is based on what direction they face, so we can do this + AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, Face); if (!itr->a_SourcePos.Equals(Vector3i(a_BlockX, a_BlockY, a_BlockZ))) { @@ -1133,7 +1134,7 @@ bool cRedstoneSimulator::IsPistonPowered(int a_BlockX, int a_BlockY, int a_Block { if (!itr->a_BlockPos.Equals(Vector3i(a_BlockX, a_BlockY, a_BlockZ))) { continue; } - AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_Meta); + AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, Face); if (!itr->a_MiddlePos.Equals(Vector3i(a_BlockX, a_BlockY, a_BlockZ))) { -- cgit v1.2.3