From fe983a1a45b23c67cf6c758a4f0ffe6a8ba764d6 Mon Sep 17 00:00:00 2001 From: x12xx12x <44411062+12xx12@users.noreply.github.com> Date: Wed, 20 Apr 2022 00:10:35 +0200 Subject: Valid Height is now checked by vector. --- src/Chunk.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/Chunk.cpp') diff --git a/src/Chunk.cpp b/src/Chunk.cpp index db09facd9..4bf4557d9 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -1022,7 +1022,7 @@ int cChunk::GrowPlantAt(Vector3i a_RelPos, int a_NumStages) bool cChunk::UnboundedRelGetBlock(Vector3i a_RelPos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const { - if (!cChunkDef::IsValidHeight(a_RelPos.y)) + if (!cChunkDef::IsValidHeight(a_RelPos)) { LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelPos.y); return false; @@ -1043,7 +1043,7 @@ bool cChunk::UnboundedRelGetBlock(Vector3i a_RelPos, BLOCKTYPE & a_BlockType, NI bool cChunk::UnboundedRelGetBlockType(Vector3i a_RelPos, BLOCKTYPE & a_BlockType) const { - if (!cChunkDef::IsValidHeight(a_RelPos.y)) + if (!cChunkDef::IsValidHeight(a_RelPos)) { LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelPos.y); return false; @@ -1064,7 +1064,7 @@ bool cChunk::UnboundedRelGetBlockType(Vector3i a_RelPos, BLOCKTYPE & a_BlockType bool cChunk::UnboundedRelGetBlockMeta(Vector3i a_RelPos, NIBBLETYPE & a_BlockMeta) const { - if (!cChunkDef::IsValidHeight(a_RelPos.y)) + if (!cChunkDef::IsValidHeight(a_RelPos)) { LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelPos.y); return false; @@ -1085,7 +1085,7 @@ bool cChunk::UnboundedRelGetBlockMeta(Vector3i a_RelPos, NIBBLETYPE & a_BlockMet bool cChunk::UnboundedRelGetBlockBlockLight(Vector3i a_RelPos, NIBBLETYPE & a_BlockBlockLight) const { - if (!cChunkDef::IsValidHeight(a_RelPos.y)) + if (!cChunkDef::IsValidHeight(a_RelPos)) { LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelPos.y); return false; @@ -1106,7 +1106,7 @@ bool cChunk::UnboundedRelGetBlockBlockLight(Vector3i a_RelPos, NIBBLETYPE & a_Bl bool cChunk::UnboundedRelGetBlockSkyLight(Vector3i a_RelPos, NIBBLETYPE & a_BlockSkyLight) const { - if (!cChunkDef::IsValidHeight(a_RelPos.y)) + if (!cChunkDef::IsValidHeight(a_RelPos)) { LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelPos.y); return false; @@ -1127,7 +1127,7 @@ bool cChunk::UnboundedRelGetBlockSkyLight(Vector3i a_RelPos, NIBBLETYPE & a_Bloc bool cChunk::UnboundedRelGetBlockLights(Vector3i a_RelPos, NIBBLETYPE & a_BlockLight, NIBBLETYPE & a_SkyLight) const { - if (!cChunkDef::IsValidHeight(a_RelPos.y)) + if (!cChunkDef::IsValidHeight(a_RelPos)) { LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelPos.y); return false; @@ -1149,7 +1149,7 @@ bool cChunk::UnboundedRelGetBlockLights(Vector3i a_RelPos, NIBBLETYPE & a_BlockL bool cChunk::UnboundedRelSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { - if (!cChunkDef::IsValidHeight(a_RelPos.y)) + if (!cChunkDef::IsValidHeight(a_RelPos)) { LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelPos.y); return false; @@ -1170,7 +1170,7 @@ bool cChunk::UnboundedRelSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBB bool cChunk::UnboundedRelFastSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { - if (!cChunkDef::IsValidHeight(a_RelPos.y)) + if (!cChunkDef::IsValidHeight(a_RelPos)) { LOGWARNING("%s: requesting a block with a_RelY out of range: %d", __FUNCTION__, a_RelPos.y); return false; -- cgit v1.2.3