summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockLeaves.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-07-01 10:40:16 +0200
committerMattes D <github@xoft.cz>2015-07-01 10:40:16 +0200
commit66a164a9a75a2d48763520aab3aeb8eeda85c92d (patch)
tree6b16a888c3abce218cd76a719312811a63f0e5f6 /src/Blocks/BlockLeaves.h
parentAPIDump: Fixed a forgotten comma. (diff)
downloadcuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar.gz
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar.bz2
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar.lz
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar.xz
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar.zst
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.zip
Diffstat (limited to 'src/Blocks/BlockLeaves.h')
-rw-r--r--src/Blocks/BlockLeaves.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h
index 5c9283979..2368eab7b 100644
--- a/src/Blocks/BlockLeaves.h
+++ b/src/Blocks/BlockLeaves.h
@@ -75,10 +75,14 @@ public:
}
- virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override
+ virtual void OnNeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_WhichNeighbor) override
{
+ // Unset 0x8 bit so this block gets checked for decay:
NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
- a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta & 0x7); // Unset 0x8 bit so it gets checked for decay
+ if ((Meta & 0x08) != 0)
+ {
+ a_ChunkInterface.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta & 0x7);
+ }
}