From 3e15c92d18c344c95bd805d7795db990258eed5a Mon Sep 17 00:00:00 2001 From: tonibm19 Date: Fri, 20 Jun 2014 10:50:21 +0200 Subject: Added pig riding. Now you can ride a pig using a carrot on a stick. --- src/Mobs/Pig.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/Mobs/Pig.cpp') diff --git a/src/Mobs/Pig.cpp b/src/Mobs/Pig.cpp index e862f5aaa..ddd98eb94 100644 --- a/src/Mobs/Pig.cpp +++ b/src/Mobs/Pig.cpp @@ -76,5 +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 (m_Attachee->IsPlayer() && m_Attachee->GetEquippedWeapon().m_ItemType == E_ITEM_CARROT_ON_STICK) + { + MoveToPosition((m_Attachee->GetPosition()) + (m_Attachee->GetLookVector()*10)); + m_bMovingToDestination = true; + } + } +} -- cgit v1.2.3