From 90c39c55a97d745de4c33e3788afb75f4c3d2bc8 Mon Sep 17 00:00:00 2001 From: tonibm19 Date: Thu, 17 Oct 2013 18:41:52 +0200 Subject: More fixes - You can only tame horses with nothing at hand - Fixed rearing --- source/Mobs/Horse.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source/Mobs/Horse.cpp') diff --git a/source/Mobs/Horse.cpp b/source/Mobs/Horse.cpp index 6876a5fa4..d027e2076 100644 --- a/source/Mobs/Horse.cpp +++ b/source/Mobs/Horse.cpp @@ -1,4 +1,3 @@ - #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "Horse.h" @@ -76,6 +75,7 @@ void cHorse::Tick(float a_Dt, cChunk & a_Chunk) if (m_RearTickCount == 20) { m_bIsRearing = false; + m_RearTickCount = 0; } else { m_RearTickCount++;} } @@ -105,7 +105,7 @@ void cHorse::OnRightClicked(cPlayer & a_Player) m_Attachee->Detach(); } - if (a_Player.GetEquippedItem().m_ItemType == E_ITEM_SADDLE && !m_bIsSaddled && m_bIsTame) + if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_SADDLE) && (!m_bIsSaddled) && (m_bIsTame)) { if (!a_Player.IsGameModeCreative()) { @@ -116,7 +116,12 @@ void cHorse::OnRightClicked(cPlayer & a_Player) m_bIsSaddled = true; m_World->BroadcastEntityMetadata(*this); } - else + else if ((a_Player.GetEquippedItem().m_ItemType != E_ITEM_EMPTY) && (!m_bIsSaddled) && (!m_bIsTame)) + { + m_bIsRearing = true; + m_RearTickCount = 0; + } + else { m_TameAttemptTimes++; a_Player.AttachTo(this); -- cgit v1.2.3