summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Zombie.cpp
diff options
context:
space:
mode:
authorwiseoldman95 <softwatt@gmx.com>2015-04-29 18:24:14 +0200
committerwiseoldman95 <softwatt@gmx.com>2015-05-01 12:18:47 +0200
commit1b0e21e0b270b3938b81df119d5a741a3e1e1257 (patch)
tree7caec55ca1792af1d0e3bcb7a8b44eeff65ac15f /src/Mobs/Zombie.cpp
parentMerge pull request #1924 from mc-server/BlockAreaCountNonAir (diff)
downloadcuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar
cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar.gz
cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar.bz2
cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar.lz
cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar.xz
cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.tar.zst
cuberite-1b0e21e0b270b3938b81df119d5a741a3e1e1257.zip
Diffstat (limited to 'src/Mobs/Zombie.cpp')
-rw-r--r--src/Mobs/Zombie.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Mobs/Zombie.cpp b/src/Mobs/Zombie.cpp
index 63042e252..b2738050e 100644
--- a/src/Mobs/Zombie.cpp
+++ b/src/Mobs/Zombie.cpp
@@ -44,17 +44,18 @@ void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer)
void cZombie::MoveToPosition(const Vector3d & a_Position)
{
- // If the destination is sufficiently skylight challenged AND the skeleton isn't on fire then block the movement
+ // Todo use WouldBurnAt(), not sure how to obtain a chunk though...
+ super::MoveToPosition(a_Position); // Look at the player and update m_Destination to hit them if they're close
+
+ // If the destination is sufficiently skylight challenged AND the skeleton isn't on fire AND we weren't attacked recently then block the movement
if (
!IsOnFire() &&
- (m_World->GetBlockSkyLight((int)floor(a_Position.x), (int)floor(a_Position.y), (int)floor(a_Position.z)) - m_World->GetSkyDarkness() > 8)
+ (m_World->GetBlockSkyLight((int)floor(a_Position.x), (int)floor(a_Position.y), (int)floor(a_Position.z)) - m_World->GetSkyDarkness() > 8) &&
+ m_TicksSinceLastDamaged == 100
)
{
- m_bMovingToDestination = false;
- return;
+ StopMovingToPosition();
}
-
- super::MoveToPosition(a_Position);
}