From 8656e149c8820272a882406912790f0075ed5f28 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 30 Jun 2015 15:50:15 +0100 Subject: Improved maps --- src/Blocks/BlockPortal.h | 49 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) (limited to 'src/Blocks/BlockPortal.h') 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 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 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; + } } ; -- cgit v1.2.3