From 40eba5244ddd7045a9c3539c5f46c9921301ed90 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 8 Aug 2020 18:22:16 +0100 Subject: Remove the redstone solid block handler - Remove cSolidBlockHandler * Functionality now integrated into simulator dispatcher * Fix door double open/close issues, arisen due to the top/bottom halves getting different power + Small migration to block states for redstone wire --- src/Simulator/Simulator.cpp | 84 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) (limited to 'src/Simulator/Simulator.cpp') diff --git a/src/Simulator/Simulator.cpp b/src/Simulator/Simulator.cpp index e55b77f0f..6b39b81d5 100644 --- a/src/Simulator/Simulator.cpp +++ b/src/Simulator/Simulator.cpp @@ -10,6 +10,90 @@ +std::array cSimulator::GetLinkedOffsets(const Vector3i Offset) +{ + if (Offset.x == -1) + { + return + { + { + { -2, 0, 0 }, + { -1, -1, 0 }, + { -1, 1, 0 }, + { -1, 0, -1 }, + { -1, 0, 1 } + } + }; + } + else if (Offset.x == 1) + { + return + { + { + { 2, 0, 0 }, + { 1, -1, 0 }, + { 1, 1, 0 }, + { 1, 0, -1 }, + { 1, 0, 1 } + } + }; + } + else if (Offset.y == -1) + { + return + { + { + { 0, -2, 0 }, + { -1, -1, 0 }, + { 1, -1, 0 }, + { 0, -1, -1 }, + { 0, -1, 1 } + } + }; + } + else if (Offset.y == 1) + { + return + { + { + { 0, 2, 0 }, + { -1, 1, 0 }, + { 1, 1, 0 }, + { 0, 1, -1 }, + { 0, 1, 1 } + } + }; + } + else if (Offset.z == -1) + { + return + { + { + { 0, 0, -2 }, + { -1, 0, -1 }, + { 1, 0, -1 }, + { 0, -1, -1 }, + { 0, 1, -1 } + } + }; + } + + return + { + { + { 0, 0, 2 }, + { -1, 0, 1 }, + { 1, 0, 1 }, + { 0, -1, 1 }, + { 0, 1, 1 } + } + }; +} + + + + + void cSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) { ASSERT(a_Chunk.IsValid()); -- cgit v1.2.3