diff options
Diffstat (limited to 'src/Mobs/Pig.cpp')
-rw-r--r-- | src/Mobs/Pig.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Mobs/Pig.cpp b/src/Mobs/Pig.cpp index ddd98eb94..1f77cf613 100644 --- a/src/Mobs/Pig.cpp +++ b/src/Mobs/Pig.cpp @@ -76,13 +76,18 @@ void cPig::OnRightClicked(cPlayer & a_Player) } } + + + + void cPig::Tick(float a_Dt, cChunk & a_Chunk) { super::Tick(a_Dt, a_Chunk); - if (m_bIsSaddled && m_Attachee != NULL) + // If the attachee player is holding a carrot-on-stick, let them drive this pig: + if (m_bIsSaddled && (m_Attachee != NULL)) { - if (m_Attachee->IsPlayer() && m_Attachee->GetEquippedWeapon().m_ItemType == E_ITEM_CARROT_ON_STICK) + if (m_Attachee->IsPlayer() && (m_Attachee->GetEquippedWeapon().m_ItemType == E_ITEM_CARROT_ON_STICK)) { MoveToPosition((m_Attachee->GetPosition()) + (m_Attachee->GetLookVector()*10)); m_bMovingToDestination = true; @@ -91,3 +96,5 @@ void cPig::Tick(float a_Dt, cChunk & a_Chunk) } + + |