summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockCarpet.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/BlockCarpet.h')
-rw-r--r--src/Blocks/BlockCarpet.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Blocks/BlockCarpet.h b/src/Blocks/BlockCarpet.h
index 841e94b11..2477ee344 100644
--- a/src/Blocks/BlockCarpet.h
+++ b/src/Blocks/BlockCarpet.h
@@ -27,7 +27,8 @@ private:
virtual bool CanBeAt(const cChunk & a_Chunk, const Vector3i a_Position, const NIBBLETYPE a_Meta) const override
{
- return (a_Position.y > 0) && (a_Chunk.GetBlock(a_Position.addedY(-1)) != E_BLOCK_AIR);
+ const auto PosBelow = a_Position.addedY(-1);
+ return cChunkDef::IsValidHeight(PosBelow) && (a_Chunk.GetBlock(PosBelow) != E_BLOCK_AIR);
}