summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-19 23:15:39 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-19 23:15:39 +0200
commit2bfe962e2831316f651aa22c4e7b7ea68021c978 (patch)
tree9b7a19ab2dc3148418203a9cae9a40b1f68a8b83 /src
parentSimplified cacti conditions (diff)
downloadcuberite-2bfe962e2831316f651aa22c4e7b7ea68021c978.tar
cuberite-2bfe962e2831316f651aa22c4e7b7ea68021c978.tar.gz
cuberite-2bfe962e2831316f651aa22c4e7b7ea68021c978.tar.bz2
cuberite-2bfe962e2831316f651aa22c4e7b7ea68021c978.tar.lz
cuberite-2bfe962e2831316f651aa22c4e7b7ea68021c978.tar.xz
cuberite-2bfe962e2831316f651aa22c4e7b7ea68021c978.tar.zst
cuberite-2bfe962e2831316f651aa22c4e7b7ea68021c978.zip
Diffstat (limited to 'src')
-rw-r--r--src/Entities/Entity.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index ed06e76b9..8a584d2ca 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -1023,11 +1023,12 @@ void cEntity::DetectCacti()
int X = POSX_TOINT, Y = POSY_TOINT, Z = POSZ_TOINT;
float w = m_Width / 2;
if (
- (((X + 1) - GetPosX() < w) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) ||
+ ((Y > 0) && (Y < cChunkDef::Height)) &&
+ ((((X + 1) - GetPosX() < w) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) ||
((GetPosX() - X < w) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) ||
(((Z + 1) - GetPosZ() < w) && (GetWorld()->GetBlock(X, Y, Z + 1) == E_BLOCK_CACTUS)) ||
((GetPosZ() - Z < w) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS)) ||
- (((Y > 0) && (Y < cChunkDef::Height)) && ((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS)))
+ (((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS))))
)
{
TakeDamage(dtCactusContact, NULL, 1, 0);