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.
This commit is contained in:
@@ -62,6 +62,7 @@ private:
|
||||
Vector3i a_BlockPos;
|
||||
short a_DelayTicks;
|
||||
short a_ElapsedTicks;
|
||||
bool ShouldPowerOn;
|
||||
};
|
||||
|
||||
typedef std::vector <sPoweredBlocks> PoweredBlocksList;
|
||||
@@ -127,6 +128,8 @@ private:
|
||||
void SetDirectionLinkedPowered(int a_BlockX, int a_BlockY, int a_BlockZ, char a_Direction, BLOCKTYPE a_SourceBlock);
|
||||
/// <summary>Marks all blocks immediately surrounding a coordinate as powered</summary>
|
||||
void SetAllDirsAsPowered(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_SourceBlock);
|
||||
/// <summary>Queues a repeater to be powered or unpowered</summary>
|
||||
void QueueRepeaterPowerChange(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_Meta, short a_ElapsedTicks, bool ShouldPowerOn);
|
||||
|
||||
/// <summary>Returns if a coordinate is powered or linked powered</summary>
|
||||
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); }
|
||||
|
||||
Reference in New Issue
Block a user