From fe983a1a45b23c67cf6c758a4f0ffe6a8ba764d6 Mon Sep 17 00:00:00 2001 From: x12xx12x <44411062+12xx12@users.noreply.github.com> Date: Wed, 20 Apr 2022 00:10:35 +0200 Subject: Valid Height is now checked by vector. --- src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp | 4 ++-- .../IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp | 2 +- src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Simulator/IncrementalRedstoneSimulator') diff --git a/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp b/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp index e8a8515eb..9c7560a6c 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator/ForEachSourceCallback.cpp @@ -26,7 +26,7 @@ ForEachSourceCallback::ForEachSourceCallback(const cChunk & Chunk, const Vector3 void ForEachSourceCallback::operator()(Vector3i Location) { - if (!cChunkDef::IsValidHeight(Location.y)) + if (!cChunkDef::IsValidHeight(Location)) { return; } @@ -96,7 +96,7 @@ PowerLevel ForEachSourceCallback::QueryLinkedPower(const cChunk & Chunk, const V for (const auto & Offset : cSimulator::GetLinkedOffsets(SolidBlockPosition - QueryPosition)) { auto SourcePosition = QueryPosition + Offset; - if (!cChunkDef::IsValidHeight(SourcePosition.y)) + if (!cChunkDef::IsValidHeight(SourcePosition)) { continue; } diff --git a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp index c27f6d04d..c23af9f75 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp @@ -217,7 +217,7 @@ void cIncrementalRedstoneSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position for (const auto & Offset : cSimulator::GetLinkedOffsets(a_Offset)) { auto Relative = a_Position - a_Offset + Offset; - if (!cChunkDef::IsValidHeight(Relative.y)) + if (!cChunkDef::IsValidHeight(Relative)) { continue; } diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h b/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h index cfdecb246..5f2026842 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h +++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneWireHandler.h @@ -313,7 +313,7 @@ namespace RedstoneWireHandler const auto YMDiagonalPosition = Relative + OffsetYM; if ( BLOCKTYPE QueryBlock; - cChunkDef::IsValidHeight(YMDiagonalPosition.y) && + cChunkDef::IsValidHeight(YMDiagonalPosition) && a_Chunk.UnboundedRelGetBlockType(YMDiagonalPosition, QueryBlock) && (QueryBlock == E_BLOCK_REDSTONE_WIRE) ) -- cgit v1.2.3