From 09c47fabd2ebfdd929a0e237070b1a3d5e1968b3 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 17 Dec 2013 23:05:27 +0000 Subject: Fixed bad repeater power queuing in corner case Repeaters remain queued to power even if their original source has since unpowered. Also functionised and cleaned up code. --- src/Simulator/RedstoneSimulator.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Simulator/RedstoneSimulator.h') diff --git a/src/Simulator/RedstoneSimulator.h b/src/Simulator/RedstoneSimulator.h index 9bdeb8f32..d40d88342 100644 --- a/src/Simulator/RedstoneSimulator.h +++ b/src/Simulator/RedstoneSimulator.h @@ -62,6 +62,7 @@ private: Vector3i a_BlockPos; short a_DelayTicks; short a_ElapsedTicks; + bool ShouldPowerOn; }; typedef std::vector PoweredBlocksList; @@ -127,6 +128,8 @@ private: void SetDirectionLinkedPowered(int a_BlockX, int a_BlockY, int a_BlockZ, char a_Direction, BLOCKTYPE a_SourceBlock); /// Marks all blocks immediately surrounding a coordinate as powered void SetAllDirsAsPowered(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_SourceBlock); + /// Queues a repeater to be powered or unpowered + void QueueRepeaterPowerChange(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_Meta, short a_ElapsedTicks, bool ShouldPowerOn); /// Returns if a coordinate is powered or linked powered 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); } -- cgit v1.2.3