summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortonibm19 <tonibm19@gmail.com>2014-01-29 18:32:46 +0100
committertonibm19 <tonibm19@gmail.com>2014-01-29 18:32:46 +0100
commitba4865f7ee99490ff46d4b584ffa0ae85fa21aae (patch)
treec9da9935db348196455602e19f516e1f89333771
parentFixed a copypasta error... (diff)
downloadcuberite-ba4865f7ee99490ff46d4b584ffa0ae85fa21aae.tar
cuberite-ba4865f7ee99490ff46d4b584ffa0ae85fa21aae.tar.gz
cuberite-ba4865f7ee99490ff46d4b584ffa0ae85fa21aae.tar.bz2
cuberite-ba4865f7ee99490ff46d4b584ffa0ae85fa21aae.tar.lz
cuberite-ba4865f7ee99490ff46d4b584ffa0ae85fa21aae.tar.xz
cuberite-ba4865f7ee99490ff46d4b584ffa0ae85fa21aae.tar.zst
cuberite-ba4865f7ee99490ff46d4b584ffa0ae85fa21aae.zip
-rw-r--r--src/Mobs/Sheep.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp
index 2478ec79c..c8ff8f5c8 100644
--- a/src/Mobs/Sheep.cpp
+++ b/src/Mobs/Sheep.cpp
@@ -68,7 +68,6 @@ void cSheep::OnRightClicked(cPlayer & a_Player)
void cSheep::Tick(float a_Dt, cChunk & a_Chunk)
{
- super::Tick(a_Dt, a_Chunk);
// The sheep should not move when he's eating so only handle the physics.
if (m_TimeToStopEating > 0)
{
@@ -96,27 +95,27 @@ void cSheep::Tick(float a_Dt, cChunk & a_Chunk)
m_TimeToStopEating = 40;
}
}
- }
- cPlayer * a_Closest_Player = m_World->FindClosestPlayer(GetPosition(), (float)m_SightDistance);
- if (a_Closest_Player != NULL)
- {
- if (a_Closest_Player->GetEquippedItem().m_ItemType == E_ITEM_WHEAT)
+ cPlayer * a_Closest_Player = m_World->FindClosestPlayer(GetPosition(), (float)m_SightDistance);
+ if (a_Closest_Player != NULL)
{
- if (!IsBegging())
+ if (a_Closest_Player->GetEquippedItem().m_ItemType == E_ITEM_WHEAT)
{
- m_IsBegging = true;
- m_World->BroadcastEntityMetadata(*this);
+ if (!IsBegging())
+ {
+ m_IsBegging = true;
+ m_World->BroadcastEntityMetadata(*this);
+ }
+ Vector3d PlayerPos = a_Closest_Player->GetPosition();
+ PlayerPos.y++;
+ m_FinalDestination = PlayerPos;
}
- Vector3d PlayerPos = a_Closest_Player->GetPosition();
- PlayerPos.y++;
- m_FinalDestination = PlayerPos;
- }
- else
- {
- if (IsBegging())
+ else
{
- m_IsBegging = false;
- m_World->BroadcastEntityMetadata(*this);
+ if (IsBegging())
+ {
+ m_IsBegging = false;
+ m_World->BroadcastEntityMetadata(*this);
+ }
}
}
}