From fad43f0c405450cba98b995fbaebec7064d2aff2 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 30 Nov 2013 15:07:21 +0000 Subject: Fixed pistons extending They didn't when a source was in front, but now they do! Yay! --- src/Simulator/RedstoneSimulator.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Simulator/RedstoneSimulator.cpp b/src/Simulator/RedstoneSimulator.cpp index d9a9372e0..c93741a0e 100644 --- a/src/Simulator/RedstoneSimulator.cpp +++ b/src/Simulator/RedstoneSimulator.cpp @@ -848,6 +848,8 @@ 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; + for (PoweredBlocksList::iterator itr = m_PoweredBlocks.begin(); itr != m_PoweredBlocks.end(); ++itr) { sPoweredBlocks & Change = *itr; @@ -860,6 +862,10 @@ bool cRedstoneSimulator::IsPistonPowered(int a_BlockX, int a_BlockY, int a_Block { return true; } + + a_BlockX = OldX; + a_BlockY = OldY; + a_BlockZ = OldZ; } for (LinkedBlocksList::iterator itr = m_LinkedPoweredBlocks.begin(); itr != m_LinkedPoweredBlocks.end(); ++itr) @@ -874,6 +880,10 @@ bool cRedstoneSimulator::IsPistonPowered(int a_BlockX, int a_BlockY, int a_Block { return true; } + + a_BlockX = OldX; + a_BlockY = OldY; + a_BlockZ = OldZ; } return false; // Source was in front of the piston's front face } -- cgit v1.2.3