From 0aeece7fdaccc8f20e96f9560c4f4c1b5a6bc5cc Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sat, 14 Dec 2013 02:40:54 +0000 Subject: Fixes to redstone wire and torches + Wires now power blocks around the block beneath * Torches no longer power off if it is on a linked powered block * Enhanced code, split functions, etc. --- src/Simulator/RedstoneSimulator.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Simulator/RedstoneSimulator.h') diff --git a/src/Simulator/RedstoneSimulator.h b/src/Simulator/RedstoneSimulator.h index 7c1fd62e8..23ac510fc 100644 --- a/src/Simulator/RedstoneSimulator.h +++ b/src/Simulator/RedstoneSimulator.h @@ -127,7 +127,11 @@ private: void SetAllDirsAsPowered(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_SourceBlock); /// Returns if a coordinate is powered or linked powered - bool AreCoordsPowered(int a_BlockX, int a_BlockY, int a_BlockZ); + bool AreCoordsPowered(int a_BlockX, int a_BlockY, int a_BlockZ) { return AreCoordsDirectlyPowered(a_BlockX, a_BlockY, a_BlockZ) || AreCoordsLinkedPowered(a_BlockX, a_BlockY, a_BlockZ); } + /// Returns if a coordinate is in the directly powered blocks list + bool AreCoordsDirectlyPowered(int a_BlockX, int a_BlockY, int a_BlockZ); + /// Returns if a coordinate is in the indirectly powered blocks list + bool AreCoordsLinkedPowered(int a_BlockX, int a_BlockY, int a_BlockZ); /// Returns if a coordinate was marked as simulated (for blocks toggleable by players) bool AreCoordsSimulated(int a_BlockX, int a_BlockY, int a_BlockZ, bool IsCurrentStatePowered); /// Returns if a repeater is powered -- cgit v1.2.3