summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockRail.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2015-12-19 22:20:56 +0100
committerTiger Wang <ziwei.tiger@outlook.com>2015-12-19 22:20:56 +0100
commitb8752bb26e91bcdcebfb8dd43e5794251ff70a89 (patch)
tree95048f5a2a833c1d43785f6eaea070627c2b9ebe /src/Blocks/BlockRail.h
parentMerge pull request #2776 from cuberite/AtomicBoolIsthread (diff)
parentReorganised the redstone simulator (diff)
downloadcuberite-b8752bb26e91bcdcebfb8dd43e5794251ff70a89.tar
cuberite-b8752bb26e91bcdcebfb8dd43e5794251ff70a89.tar.gz
cuberite-b8752bb26e91bcdcebfb8dd43e5794251ff70a89.tar.bz2
cuberite-b8752bb26e91bcdcebfb8dd43e5794251ff70a89.tar.lz
cuberite-b8752bb26e91bcdcebfb8dd43e5794251ff70a89.tar.xz
cuberite-b8752bb26e91bcdcebfb8dd43e5794251ff70a89.tar.zst
cuberite-b8752bb26e91bcdcebfb8dd43e5794251ff70a89.zip
Diffstat (limited to 'src/Blocks/BlockRail.h')
-rw-r--r--src/Blocks/BlockRail.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Blocks/BlockRail.h b/src/Blocks/BlockRail.h
index b603bb1a7..734ee93c7 100644
--- a/src/Blocks/BlockRail.h
+++ b/src/Blocks/BlockRail.h
@@ -73,10 +73,11 @@ public:
virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_WhichNeighbor) override
{
- NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
- if (IsUnstable(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ) && (Meta != FindMeta(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ)))
+ auto Meta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
+ auto NewMeta = FindMeta(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ);
+ if (IsUnstable(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ) && (Meta != NewMeta))
{
- a_ChunkInterface.FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, m_BlockType, FindMeta(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ));
+ a_ChunkInterface.FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, m_BlockType, (m_BlockType == E_BLOCK_RAIL) ? NewMeta : NewMeta | (Meta & 0x08));
}
}