diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-06-16 19:06:09 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-06-16 19:06:09 +0200 |
commit | 74cd73058955683c277baf29f3cd7378c79292a9 (patch) | |
tree | 64d74b43bb37c4e98c6146faff84cc1431b07611 /src/Simulator | |
parent | Refactored reversing logic into seperate function (diff) | |
download | cuberite-74cd73058955683c277baf29f3cd7378c79292a9.tar cuberite-74cd73058955683c277baf29f3cd7378c79292a9.tar.gz cuberite-74cd73058955683c277baf29f3cd7378c79292a9.tar.bz2 cuberite-74cd73058955683c277baf29f3cd7378c79292a9.tar.lz cuberite-74cd73058955683c277baf29f3cd7378c79292a9.tar.xz cuberite-74cd73058955683c277baf29f3cd7378c79292a9.tar.zst cuberite-74cd73058955683c277baf29f3cd7378c79292a9.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Simulator/IncrementalRedstoneSimulator.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp index a49d0fb50..1e7ff543d 100644 --- a/src/Simulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator.cpp @@ -549,26 +549,7 @@ void cIncrementalRedstoneSimulator::HandleRedstoneButton(int a_RelBlockX, int a_ SetAllDirsAsPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ); eBlockFace Dir = cBlockButtonHandler::BlockMetaDataToBlockFace(Meta); - switch (Dir) // Now, flip the direction into the type used by SetBlockLinkedPowered() - { - case BLOCK_FACE_XP: - case BLOCK_FACE_ZP: - { - Dir--; - break; - } - case BLOCK_FACE_XM: - case BLOCK_FACE_ZM: - { - Dir++; - break; - } - default: - { - ASSERT(!"Unhandled button metadata!"); - return; - } - } + Dir = ReverseBlockFace(Dir); SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, Dir); } } |