From e5cfe0cd96a67b493b91e7576ec0341452c23855 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 13 Jun 2015 14:57:51 +0200 Subject: Added a size check for portals. Made the portal size configurable Alpha-sorted SetXYZNetherPortalXYZ functions --- src/Blocks/BlockFire.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/Blocks/BlockFire.h') diff --git a/src/Blocks/BlockFire.h b/src/Blocks/BlockFire.h index ec752885a..3f75455da 100644 --- a/src/Blocks/BlockFire.h +++ b/src/Blocks/BlockFire.h @@ -121,6 +121,20 @@ public: } } + int PortalHeight = MaxY - Y - 1; + int PortalWidth = XZP - XZM + 1; + if ((PortalHeight < a_WorldInterface.GetMinNetherPortalHeight()) || (PortalHeight > a_WorldInterface.GetMaxNetherPortalHeight())) + { + // The portal isn't high enough, or is too high + return; + } + + if ((PortalWidth < a_WorldInterface.GetMinNetherPortalWidth()) || (PortalWidth > a_WorldInterface.GetMaxNetherPortalWidth())) + { + // The portal isn't wide enough, or is too wide + return; + } + for (int Height = Y + 1; Height <= MaxY - 1; Height++) // Loop through boundary to set portal blocks { for (int Width = XZM; Width <= XZP; Width++) -- cgit v1.2.3