diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-11-30 16:07:21 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-11-30 16:07:21 +0100 |
commit | fad43f0c405450cba98b995fbaebec7064d2aff2 (patch) | |
tree | 57424497520da28fca636b857925861d1515ca1e /src | |
parent | Merge branch 'trapdoors' of https://github.com/mc-server/MCServer into trapdoors (diff) | |
download | cuberite-fad43f0c405450cba98b995fbaebec7064d2aff2.tar cuberite-fad43f0c405450cba98b995fbaebec7064d2aff2.tar.gz cuberite-fad43f0c405450cba98b995fbaebec7064d2aff2.tar.bz2 cuberite-fad43f0c405450cba98b995fbaebec7064d2aff2.tar.lz cuberite-fad43f0c405450cba98b995fbaebec7064d2aff2.tar.xz cuberite-fad43f0c405450cba98b995fbaebec7064d2aff2.tar.zst cuberite-fad43f0c405450cba98b995fbaebec7064d2aff2.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Simulator/RedstoneSimulator.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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 } |