summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-31 11:27:56 +0200
committerMattes D <github@xoft.cz>2014-08-31 11:27:56 +0200
commite9f9539310d2868ff223a66e02fdef80fb43e5cf (patch)
treed7bca15609b31f710a02b5170ae4c4de82325f3f /src
parentMerge pull request #1355 from mc-server/fixes (diff)
parentCheck range of y in HasNearLog (diff)
downloadcuberite-e9f9539310d2868ff223a66e02fdef80fb43e5cf.tar
cuberite-e9f9539310d2868ff223a66e02fdef80fb43e5cf.tar.gz
cuberite-e9f9539310d2868ff223a66e02fdef80fb43e5cf.tar.bz2
cuberite-e9f9539310d2868ff223a66e02fdef80fb43e5cf.tar.lz
cuberite-e9f9539310d2868ff223a66e02fdef80fb43e5cf.tar.xz
cuberite-e9f9539310d2868ff223a66e02fdef80fb43e5cf.tar.zst
cuberite-e9f9539310d2868ff223a66e02fdef80fb43e5cf.zip
Diffstat (limited to 'src')
-rw-r--r--src/Blocks/BlockLeaves.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h
index 972dd6232..a8aa28a0f 100644
--- a/src/Blocks/BlockLeaves.h
+++ b/src/Blocks/BlockLeaves.h
@@ -152,7 +152,7 @@ bool HasNearLog(cBlockArea & a_Area, int a_BlockX, int a_BlockY, int a_BlockZ)
a_Area.SetBlockType(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_SPONGE);
for (int i = 0; i < LEAVES_CHECK_DISTANCE; i++)
{
- for (int y = a_BlockY - i; y <= a_BlockY + i; y++)
+ for (int y = std::max(a_BlockY - i, 0); y <= std::min(a_BlockY + i, 255); y++)
{
for (int z = a_BlockZ - i; z <= a_BlockZ + i; z++)
{