diff options
author | andrew <xdotftw@gmail.com> | 2014-02-20 14:37:15 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-02-20 14:37:15 +0100 |
commit | 83d3a2eedf88a3a180b9dfc4c706838d7f99382a (patch) | |
tree | d96970727615c681efe3bf76793015cead438394 /src/Mobs/Monster.cpp | |
parent | cMapDecorator: Implemented random rotations (diff) | |
parent | APIDump: Fixed cBlockArea:GetRelBlockType() return types. (diff) | |
download | cuberite-83d3a2eedf88a3a180b9dfc4c706838d7f99382a.tar cuberite-83d3a2eedf88a3a180b9dfc4c706838d7f99382a.tar.gz cuberite-83d3a2eedf88a3a180b9dfc4c706838d7f99382a.tar.bz2 cuberite-83d3a2eedf88a3a180b9dfc4c706838d7f99382a.tar.lz cuberite-83d3a2eedf88a3a180b9dfc4c706838d7f99382a.tar.xz cuberite-83d3a2eedf88a3a180b9dfc4c706838d7f99382a.tar.zst cuberite-83d3a2eedf88a3a180b9dfc4c706838d7f99382a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Monster.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index ad3a87725..b5cf693cb 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -142,11 +142,11 @@ void cMonster::TickPathFinding() BLOCKTYPE BlockAtYPP = m_World->GetBlock(gCrossCoords[i].x + PosX, PosY + 2, gCrossCoords[i].z + PosZ); BLOCKTYPE BlockAtYM = m_World->GetBlock(gCrossCoords[i].x + PosX, PosY - 1, gCrossCoords[i].z + PosZ); - if (!g_BlockIsSolid[BlockAtY] && !g_BlockIsSolid[BlockAtYP] && !IsBlockLava(BlockAtYM)) + if ((!g_BlockIsSolid[BlockAtY]) && (!g_BlockIsSolid[BlockAtYP]) && (!IsBlockLava(BlockAtYM)) && (BlockAtY != E_BLOCK_FENCE) && (BlockAtY != E_BLOCK_FENCE_GATE)) { m_PotentialCoordinates.push_back(Vector3d((gCrossCoords[i].x + PosX), PosY, gCrossCoords[i].z + PosZ)); } - else if (g_BlockIsSolid[BlockAtY] && !g_BlockIsSolid[BlockAtYP] && !g_BlockIsSolid[BlockAtYPP] && !IsBlockLava(BlockAtYM)) + else if ((g_BlockIsSolid[BlockAtY]) && (!g_BlockIsSolid[BlockAtYP]) && (!g_BlockIsSolid[BlockAtYPP]) && (!IsBlockLava(BlockAtYM)) && (BlockAtY != E_BLOCK_FENCE) && (BlockAtY != E_BLOCK_FENCE_GATE)) { m_PotentialCoordinates.push_back(Vector3d((gCrossCoords[i].x + PosX), PosY + 1, gCrossCoords[i].z + PosZ)); } @@ -311,9 +311,6 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk) } } - if (ReachedFinalDestination() && (m_Target != NULL)) - Attack(a_Dt); - SetPitchAndYawFromDestination(); HandleFalling(); @@ -657,17 +654,6 @@ void cMonster::InStateEscaping(float a_Dt) -// Do attack here -// a_Dt is passed so we can set attack rate -void cMonster::Attack(float a_Dt) -{ - m_AttackInterval += a_Dt * m_AttackRate; -} - - - - - void cMonster::GetMonsterConfig(const AString & a_Name) { cRoot::Get()->GetMonsterConfig()->AssignAttributes(this, a_Name); |