diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-01-19 19:24:56 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-01-19 19:24:56 +0100 |
commit | fc622ce1940c392dd5a049b8bd1c3017927894dd (patch) | |
tree | 14ea8017e7a9c929dc6f54fbe73b75e613c585ac /src | |
parent | Added more rail functionality (diff) | |
download | cuberite-fc622ce1940c392dd5a049b8bd1c3017927894dd.tar cuberite-fc622ce1940c392dd5a049b8bd1c3017927894dd.tar.gz cuberite-fc622ce1940c392dd5a049b8bd1c3017927894dd.tar.bz2 cuberite-fc622ce1940c392dd5a049b8bd1c3017927894dd.tar.lz cuberite-fc622ce1940c392dd5a049b8bd1c3017927894dd.tar.xz cuberite-fc622ce1940c392dd5a049b8bd1c3017927894dd.tar.zst cuberite-fc622ce1940c392dd5a049b8bd1c3017927894dd.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Blocks/BlockRail.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/Blocks/BlockRail.h b/src/Blocks/BlockRail.h index f13e987b7..da3783d08 100644 --- a/src/Blocks/BlockRail.h +++ b/src/Blocks/BlockRail.h @@ -186,22 +186,32 @@ public: } if (RailsCnt > 1) { - if (Neighbors[3] && Neighbors[0]) return E_META_RAIL_CURVED_ZP_XP; - else if (Neighbors[3] && Neighbors[1]) return E_META_RAIL_CURVED_ZP_XM; - else if (Neighbors[2] && Neighbors[0]) return E_META_RAIL_CURVED_ZM_XP; - else if (Neighbors[2] && Neighbors[1]) return E_META_RAIL_CURVED_ZM_XM; + if (Neighbors[3] && Neighbors[0] && CanThisRailCurve()) return E_META_RAIL_CURVED_ZP_XP; + else if (Neighbors[3] && Neighbors[1] && CanThisRailCurve()) return E_META_RAIL_CURVED_ZP_XM; + else if (Neighbors[2] && Neighbors[0] && CanThisRailCurve()) return E_META_RAIL_CURVED_ZM_XP; + else if (Neighbors[2] && Neighbors[1] && CanThisRailCurve()) return E_META_RAIL_CURVED_ZM_XM; else if (Neighbors[7] && Neighbors[2]) return E_META_RAIL_ASCEND_ZP; else if (Neighbors[3] && Neighbors[6]) return E_META_RAIL_ASCEND_ZM; else if (Neighbors[5] && Neighbors[0]) return E_META_RAIL_ASCEND_XM; else if (Neighbors[4] && Neighbors[1]) return E_META_RAIL_ASCEND_XP; else if (Neighbors[0] && Neighbors[1]) return E_META_RAIL_XM_XP; else if (Neighbors[2] && Neighbors[3]) return E_META_RAIL_ZM_ZP; - ASSERT(!"Weird neighbor count"); + + if (CanThisRailCurve()) + { + ASSERT(!"Weird neighbor count"); + } } return Meta; } + inline bool CanThisRailCurve(void) + { + return m_BlockType == E_BLOCK_RAIL; + } + + bool IsUnstable(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) { if (!IsBlockRail(a_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ))) |