1
0

Should have fixed assumptions about entity width.

@madmaxoft can you comment?
This commit is contained in:
Alexander Harkness 2014-05-19 10:35:21 +01:00
parent 70cf4a5eaf
commit dc39d88d3f

View File

@ -1005,11 +1005,12 @@ void cEntity::TickInVoid(cChunk & a_Chunk)
void cEntity::DetectCacti()
{
int X = POSX_TOINT, Y = POSY_TOINT, Z = POSZ_TOINT;
float w = m_Width / 2
if (
(((X + 1) - GetPosX() < 0.3) && (GetWorld()->GetBlock(X + 1, Y, Z) == E_BLOCK_CACTUS)) ||
(((GetPosX() - (X - 1)) - 1 < 0.3) && (GetWorld()->GetBlock(X - 1, Y, Z) == E_BLOCK_CACTUS)) ||
(((Z + 1) - GetPosZ() < 0.3) && (GetWorld()->GetBlock(X, Y, Z + 1) == E_BLOCK_CACTUS)) ||
(((GetPosZ() - (Z - 1)) - 1 < 0.3) && (GetWorld()->GetBlock(X, Y, Z - 1) == E_BLOCK_CACTUS)) ||
(((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)) ||
(((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)))
)
{