diff options
Diffstat (limited to 'src/Blocks/BlockPortal.h')
-rw-r--r-- | src/Blocks/BlockPortal.h | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/src/Blocks/BlockPortal.h b/src/Blocks/BlockPortal.h index 581a29447..c18acbdb5 100644 --- a/src/Blocks/BlockPortal.h +++ b/src/Blocks/BlockPortal.h @@ -33,7 +33,6 @@ public: return true; } - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { // No pickups @@ -64,21 +63,20 @@ public: { case 0x1: { - static const struct - { - int x, y, z; - } PortalCheck[] = + static const std::array<Vector3i, 4> PortalCheck { - { 0, 1, 0}, - { 0, -1, 0}, - { 1, 0, 0}, - {-1, 0, 0}, - } ; + { + { 0, 1, 0 }, + { 0, -1, 0 }, + { 1, 0, 0 }, + { -1, 0, 0 }, + } + }; - for (size_t i = 0; i < ARRAYCOUNT(PortalCheck); i++) + for (const auto & Direction : PortalCheck) { BLOCKTYPE Block; - a_Chunk.UnboundedRelGetBlockType(a_RelX + PortalCheck[i].x, a_RelY + PortalCheck[i].y, a_RelZ + PortalCheck[i].z, Block); + a_Chunk.UnboundedRelGetBlockType(a_RelX + Direction.x, a_RelY + Direction.y, a_RelZ + Direction.z, Block); if ((Block != E_BLOCK_NETHER_PORTAL) && (Block != E_BLOCK_OBSIDIAN)) { @@ -89,21 +87,20 @@ public: } case 0x2: { - static const struct - { - int x, y, z; - } PortalCheck[] = + static const std::array<Vector3i, 4> PortalCheck { - { 0, 1, 0}, - { 0, -1, 0}, - { 0, 0, -1}, - { 0, 0, 1}, - } ; + { + { 0, 1, 0 }, + { 0, -1, 0 }, + { 0, 0, -1 }, + { 0, 0, 1 }, + } + }; - for (size_t i = 0; i < ARRAYCOUNT(PortalCheck); i++) + for (const auto & Direction : PortalCheck) { BLOCKTYPE Block; - a_Chunk.UnboundedRelGetBlockType(a_RelX + PortalCheck[i].x, a_RelY + PortalCheck[i].y, a_RelZ + PortalCheck[i].z, Block); + a_Chunk.UnboundedRelGetBlockType(a_RelX + Direction.x, a_RelY + Direction.y, a_RelZ + Direction.z, Block); if ((Block != E_BLOCK_NETHER_PORTAL) && (Block != E_BLOCK_OBSIDIAN)) { @@ -115,6 +112,12 @@ public: } return true; } + + virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override + { + UNUSED(a_Meta); + return 24; + } } ; |