summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-25 00:56:05 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-25 00:56:05 +0100
commitb367a74d3e56927e3a1f55738fb13abd6d667814 (patch)
treeb4b28321614a3f497fdaebf1bc54869b2cdc4beb
parentMiscellaneous improvements (diff)
downloadcuberite-b367a74d3e56927e3a1f55738fb13abd6d667814.tar
cuberite-b367a74d3e56927e3a1f55738fb13abd6d667814.tar.gz
cuberite-b367a74d3e56927e3a1f55738fb13abd6d667814.tar.bz2
cuberite-b367a74d3e56927e3a1f55738fb13abd6d667814.tar.lz
cuberite-b367a74d3e56927e3a1f55738fb13abd6d667814.tar.xz
cuberite-b367a74d3e56927e3a1f55738fb13abd6d667814.tar.zst
cuberite-b367a74d3e56927e3a1f55738fb13abd6d667814.zip
-rw-r--r--src/Mobs/Skeleton.cpp11
-rw-r--r--src/Mobs/Zombie.cpp13
2 files changed, 15 insertions, 9 deletions
diff --git a/src/Mobs/Skeleton.cpp b/src/Mobs/Skeleton.cpp
index 509c2191e..4c8e78988 100644
--- a/src/Mobs/Skeleton.cpp
+++ b/src/Mobs/Skeleton.cpp
@@ -30,15 +30,18 @@ void cSkeleton::GetDrops(cItems & a_Drops, cEntity * a_Killer)
void cSkeleton::MoveToPosition(const Vector3f & a_Position)
{
- m_Destination = a_Position;
-
// If the destination is in the sun and if it is not night AND the skeleton isn't on fire then block the movement.
- if (!IsOnFire() && m_World->GetTimeOfDay() < 13187 && m_World->GetBlockSkyLight((int) a_Position.x, (int) a_Position.y, (int) a_Position.z) == 15)
+ if (
+ !IsOnFire() &&
+ (m_World->GetTimeOfDay() < 13187) &&
+ (m_World->GetBlockSkyLight((int) a_Position.x, (int) a_Position.y, (int) a_Position.z) == 15)
+ )
{
m_bMovingToDestination = false;
return;
}
- m_bMovingToDestination = true;
+
+ super::MoveToPosition(a_Position);
}
diff --git a/src/Mobs/Zombie.cpp b/src/Mobs/Zombie.cpp
index a046fcc92..27e8ed5fb 100644
--- a/src/Mobs/Zombie.cpp
+++ b/src/Mobs/Zombie.cpp
@@ -34,15 +34,18 @@ void cZombie::GetDrops(cItems & a_Drops, cEntity * a_Killer)
void cZombie::MoveToPosition(const Vector3f & a_Position)
{
- m_Destination = a_Position;
-
- // If the destination is in the sun and if it is not night AND the skeleton isn't on fire then block the movement.
- if ((m_World->GetBlockSkyLight((int) a_Position.x, (int) a_Position.y, (int) a_Position.z) == 15) && (m_World->GetTimeOfDay() < 13187) && !IsOnFire())
+ // If the destination is in the sun and if it is not night AND the zombie isn't on fire then block the movement.
+ if (
+ !IsOnFire() &&
+ (m_World->GetTimeOfDay() < 13187) &&
+ (m_World->GetBlockSkyLight((int)a_Position.x, (int)a_Position.y, (int)a_Position.z) == 15)
+ )
{
m_bMovingToDestination = false;
return;
}
- m_bMovingToDestination = true;
+
+ super::MoveToPosition(a_Position);
}