From 6fe863c2adf0b13c2625b784000a4dd882c4e046 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Sat, 25 Feb 2017 19:14:08 +0100 Subject: Fixed cactus detection and zombie pigman sword (#3584) Fixes for issues #902 and #2917 --- src/Entities/Entity.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Entities/Entity.cpp') 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); -- cgit v1.2.3