From cbff1378fd78b6eaa59bad21759c8b89f1dab341 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 5 Feb 2017 16:00:38 +0100 Subject: Fixed bindings for cBlockArea:Read and Write. (#3568) The original bindings accepted nil as the World param, causing a crash. --- src/Blocks/BlockChest.h | 4 ++-- src/Blocks/BlockFarmland.h | 2 +- src/Blocks/BlockLeaves.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockChest.h b/src/Blocks/BlockChest.h index 2c34beeeb..f8d69e5c6 100644 --- a/src/Blocks/BlockChest.h +++ b/src/Blocks/BlockChest.h @@ -37,7 +37,7 @@ public: // Check if this forms a doublechest, if so, need to adjust the meta: cBlockArea Area; - if (!Area.Read(&a_ChunkInterface, a_BlockX - 1, a_BlockX + 1, a_BlockY, a_BlockY, a_BlockZ - 1, a_BlockZ + 1)) + if (!Area.Read(a_ChunkInterface, a_BlockX - 1, a_BlockX + 1, a_BlockY, a_BlockY, a_BlockZ - 1, a_BlockZ + 1)) { return false; } @@ -75,7 +75,7 @@ public: virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) { cBlockArea Area; - if (!Area.Read(&a_ChunkInterface, a_BlockX - 2, a_BlockX + 2, a_BlockY, a_BlockY, a_BlockZ - 2, a_BlockZ + 2)) + if (!Area.Read(a_ChunkInterface, a_BlockX - 2, a_BlockX + 2, a_BlockY, a_BlockY, a_BlockZ - 2, a_BlockZ + 2)) { // Cannot read the surroundings, probably at the edge of loaded chunks. Disallow. return false; diff --git a/src/Blocks/BlockFarmland.h b/src/Blocks/BlockFarmland.h index 412eb1d2c..ddbd79335 100644 --- a/src/Blocks/BlockFarmland.h +++ b/src/Blocks/BlockFarmland.h @@ -109,7 +109,7 @@ public: cBlockArea Area; int BlockX = a_RelX + a_Chunk.GetPosX() * cChunkDef::Width; int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width; - if (!Area.Read(a_Chunk.GetWorld(), BlockX - 4, BlockX + 4, a_RelY, a_RelY + 1, BlockZ - 4, BlockZ + 4)) + if (!Area.Read(*a_Chunk.GetWorld(), BlockX - 4, BlockX + 4, a_RelY, a_RelY + 1, BlockZ - 4, BlockZ + 4)) { // Too close to the world edge, cannot check surroundings return false; diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h index 6c2905171..73c93116e 100644 --- a/src/Blocks/BlockLeaves.h +++ b/src/Blocks/BlockLeaves.h @@ -104,7 +104,7 @@ public: int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width; cBlockArea Area; if (!Area.Read( - a_Chunk.GetWorld(), + *a_Chunk.GetWorld(), BlockX - LEAVES_CHECK_DISTANCE, BlockX + LEAVES_CHECK_DISTANCE, a_RelY - LEAVES_CHECK_DISTANCE, a_RelY + LEAVES_CHECK_DISTANCE, BlockZ - LEAVES_CHECK_DISTANCE, BlockZ + LEAVES_CHECK_DISTANCE, -- cgit v1.2.3