summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2013-12-10 00:48:06 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2013-12-10 00:48:06 +0100
commitebad87d870174ed2e99be5d4f4404a8ad2aa8ab8 (patch)
tree37e7668a3794244a93c2aaaae6d310e90ff12e61
parentChanged more FastSetBlocks to SetBlocks (diff)
downloadcuberite-ebad87d870174ed2e99be5d4f4404a8ad2aa8ab8.tar
cuberite-ebad87d870174ed2e99be5d4f4404a8ad2aa8ab8.tar.gz
cuberite-ebad87d870174ed2e99be5d4f4404a8ad2aa8ab8.tar.bz2
cuberite-ebad87d870174ed2e99be5d4f4404a8ad2aa8ab8.tar.lz
cuberite-ebad87d870174ed2e99be5d4f4404a8ad2aa8ab8.tar.xz
cuberite-ebad87d870174ed2e99be5d4f4404a8ad2aa8ab8.tar.zst
cuberite-ebad87d870174ed2e99be5d4f4404a8ad2aa8ab8.zip
-rw-r--r--src/Simulator/RedstoneSimulator.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Simulator/RedstoneSimulator.cpp b/src/Simulator/RedstoneSimulator.cpp
index 424e22ca4..c5fc1fb3f 100644
--- a/src/Simulator/RedstoneSimulator.cpp
+++ b/src/Simulator/RedstoneSimulator.cpp
@@ -420,6 +420,7 @@ void cRedstoneSimulator::HandleRedstoneWire(int a_BlockX, int a_BlockY, int a_Bl
}
else
{
+ NIBBLETYPE MetaToSet = 0;
NIBBLETYPE MyMeta = m_World.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
int TimesMetaSmaller = 0, TimesFoundAWire = 0;
@@ -439,7 +440,7 @@ void cRedstoneSimulator::HandleRedstoneWire(int a_BlockX, int a_BlockY, int a_Bl
// >= to fix a bug where wires bordering each other with the same power level will appear (in terms of meta) to power each other, when they aren't actually in the powered list
if (SurroundMeta >= MyMeta)
{
- m_World.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, SurroundMeta - 1);
+ MetaToSet = SurroundMeta - 1; // To improve performance
}
}
@@ -459,6 +460,10 @@ void cRedstoneSimulator::HandleRedstoneWire(int a_BlockX, int a_BlockY, int a_Bl
m_World.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, 0);
return; // No need to process block power sets because self not powered
}
+ else
+ {
+ m_World.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, MetaToSet);
+ }
SetBlockPowered(a_BlockX, a_BlockY - 1, a_BlockZ, a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_REDSTONE_WIRE); // Power block beneath
}