summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/RedstoneRepeaterHandler.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-08-20 21:04:28 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-21 01:50:09 +0200
commitd8c8d0124da12587bbaf52992f7a8d2e0b010544 (patch)
tree305983c82fdb55ec7f9bc37cda1b54304f4a0ecf /src/Simulator/IncrementalRedstoneSimulator/RedstoneRepeaterHandler.h
parentcChunk's deleted copy constructor needs const (diff)
downloadcuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar.gz
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar.bz2
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar.lz
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar.xz
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.tar.zst
cuberite-d8c8d0124da12587bbaf52992f7a8d2e0b010544.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/RedstoneRepeaterHandler.h')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/RedstoneRepeaterHandler.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneRepeaterHandler.h b/src/Simulator/IncrementalRedstoneSimulator/RedstoneRepeaterHandler.h
index ed890a8bb..82678896a 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneRepeaterHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneRepeaterHandler.h
@@ -81,7 +81,7 @@ namespace RedstoneRepeaterHandler
return Rhs.first && DoesLhsLockMe(a_Meta, Rhs.second);
}
- inline unsigned char GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
+ inline PowerLevel GetPowerDeliveredToPosition(const cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_BlockType, Vector3i a_QueryPosition, BLOCKTYPE a_QueryBlockType, bool IsLinked)
{
if (!IsOn(a_BlockType))
{
@@ -98,7 +98,7 @@ namespace RedstoneRepeaterHandler
return 0;
}
- inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, PoweringData a_PoweringData)
+ inline void Update(cChunk & a_Chunk, cChunk & CurrentlyTicking, Vector3i a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_Meta, const PowerLevel Power)
{
// LOGD("Evaluating loopy the repeater (%d %d %d)", a_Position.x, a_Position.y, a_Position.z);
@@ -118,7 +118,7 @@ namespace RedstoneRepeaterHandler
if (DelayInfo == nullptr)
{
- bool ShouldBeOn = (a_PoweringData.PowerLevel != 0);
+ bool ShouldBeOn = (Power != 0);
if (ShouldBeOn != IsOn(a_BlockType))
{
Data.m_MechanismDelays[a_Position] = std::make_pair((((a_Meta & 0xC) >> 0x2) + 1), ShouldBeOn);
@@ -143,7 +143,7 @@ namespace RedstoneRepeaterHandler
// While sleeping, we ignore any power changes and apply our saved ShouldBeOn when sleep expires
// Now, we need to recalculate to be aware of any new changes that may e.g. cause a new output change
// FastSetBlock doesn't wake simulators, so manually update ourselves:
- Update(a_Chunk, CurrentlyTicking, a_Position, NewType, a_Meta, a_PoweringData);
+ Update(a_Chunk, CurrentlyTicking, a_Position, NewType, a_Meta, Power);
UpdateAdjustedRelative(a_Chunk, CurrentlyTicking, a_Position, cBlockRedstoneRepeaterHandler::GetFrontCoordinateOffset(a_Meta));
}