summaryrefslogtreecommitdiffstats
path: root/src/Entities/Entity.cpp
diff options
context:
space:
mode:
authorBond-009 <Bond-009@users.noreply.github.com>2017-02-25 19:14:08 +0100
committerMattes D <github@xoft.cz>2017-02-25 19:14:08 +0100
commit6fe863c2adf0b13c2625b784000a4dd882c4e046 (patch)
treea23f2e533479c617734665aa651a9e22f29388db /src/Entities/Entity.cpp
parentBlockCrops: Fixed comments and reformatted control flow. (#3576) (diff)
downloadcuberite-6fe863c2adf0b13c2625b784000a4dd882c4e046.tar
cuberite-6fe863c2adf0b13c2625b784000a4dd882c4e046.tar.gz
cuberite-6fe863c2adf0b13c2625b784000a4dd882c4e046.tar.bz2
cuberite-6fe863c2adf0b13c2625b784000a4dd882c4e046.tar.lz
cuberite-6fe863c2adf0b13c2625b784000a4dd882c4e046.tar.xz
cuberite-6fe863c2adf0b13c2625b784000a4dd882c4e046.tar.zst
cuberite-6fe863c2adf0b13c2625b784000a4dd882c4e046.zip
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r--src/Entities/Entity.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index d155d9d9d..a37100c8b 100644
--- a/src/Entities/Entity.cpp
+++ b/src/Entities/Entity.cpp
@@ -1359,7 +1359,8 @@ void cEntity::DetectCacti(void)
((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)) ||
- (((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y, Z) == E_BLOCK_CACTUS))))
+ (((Y + 1) - GetPosY() < w) && (GetWorld()->GetBlock(X, Y + 1, Z) == E_BLOCK_CACTUS)) ||
+ ((GetPosY() - Y < 1) && (GetWorld()->GetBlock(X, Y - 1, Z) == E_BLOCK_CACTUS)))
)
{
TakeDamage(dtCactusContact, nullptr, 1, 0);