Merged branch 'tonibm19/master'.
This commit is contained in:
commit
7102e9edb0
@ -78,3 +78,23 @@ void cPig::OnRightClicked(cPlayer & a_Player)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void cPig::Tick(float a_Dt, cChunk & a_Chunk)
|
||||||
|
{
|
||||||
|
super::Tick(a_Dt, a_Chunk);
|
||||||
|
|
||||||
|
// 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))
|
||||||
|
{
|
||||||
|
MoveToPosition((m_Attachee->GetPosition()) + (m_Attachee->GetLookVector()*10));
|
||||||
|
m_bMovingToDestination = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ public:
|
|||||||
|
|
||||||
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
|
virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override;
|
||||||
virtual void OnRightClicked(cPlayer & a_Player) override;
|
virtual void OnRightClicked(cPlayer & a_Player) override;
|
||||||
|
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
|
||||||
|
|
||||||
virtual const cItem GetFollowedItem(void) const override { return cItem(E_ITEM_CARROT); }
|
virtual const cItem GetFollowedItem(void) const override { return cItem(E_ITEM_CARROT); }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user