summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-05-25 10:42:30 +0200
committerMattes D <github@xoft.cz>2014-05-25 10:42:30 +0200
commit0849e66d039ef390b8525e9e411882ce1b4ad91e (patch)
treeb14c5ade801aa9ba681ba598d3ceed63e444ec81 /src/Entities/Entity.cpp
parentUpdated Core (diff)
parentMerge branch 'master' into achievementtranslate (diff)
downloadcuberite-0849e66d039ef390b8525e9e411882ce1b4ad91e.tar
cuberite-0849e66d039ef390b8525e9e411882ce1b4ad91e.tar.gz
cuberite-0849e66d039ef390b8525e9e411882ce1b4ad91e.tar.bz2
cuberite-0849e66d039ef390b8525e9e411882ce1b4ad91e.tar.lz
cuberite-0849e66d039ef390b8525e9e411882ce1b4ad91e.tar.xz
cuberite-0849e66d039ef390b8525e9e411882ce1b4ad91e.tar.zst
cuberite-0849e66d039ef390b8525e9e411882ce1b4ad91e.zip
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r--src/Entities/Entity.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index 2567b7adc..1226a2319 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -1023,11 +1023,12 @@ void cEntity::DetectCacti(void)
int X = POSX_TOINT, Y = POSY_TOINT, Z = POSZ_TOINT;
double w = m_Width / 2;
if (
- (((X + 1) - GetPosX() < w) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) ||
- (((GetPosX() - (X - 1)) - 1 < 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 - 1)) - 1 < 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)))
+ ((GetPosZ() - Z < w) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS)) ||
+ (((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS))))
)
{
TakeDamage(dtCactusContact, NULL, 1, 0);