diff options
author | tonibm19 <tonibm19@gmail.com> | 2013-10-17 21:28:45 +0200 |
---|---|---|
committer | tonibm19 <tonibm19@gmail.com> | 2013-10-17 21:28:45 +0200 |
commit | 2c187e53b73eb7104297fd2fa0a25914ff235981 (patch) | |
tree | 7f5cfa012d1cfa5b7e3140e6bc5e3285e021a6b9 /source/Mobs/Horse.cpp | |
parent | More fixes (diff) | |
download | cuberite-2c187e53b73eb7104297fd2fa0a25914ff235981.tar cuberite-2c187e53b73eb7104297fd2fa0a25914ff235981.tar.gz cuberite-2c187e53b73eb7104297fd2fa0a25914ff235981.tar.bz2 cuberite-2c187e53b73eb7104297fd2fa0a25914ff235981.tar.lz cuberite-2c187e53b73eb7104297fd2fa0a25914ff235981.tar.xz cuberite-2c187e53b73eb7104297fd2fa0a25914ff235981.tar.zst cuberite-2c187e53b73eb7104297fd2fa0a25914ff235981.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Mobs/Horse.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/source/Mobs/Horse.cpp b/source/Mobs/Horse.cpp index d027e2076..0077145dc 100644 --- a/source/Mobs/Horse.cpp +++ b/source/Mobs/Horse.cpp @@ -1,3 +1,4 @@ + #include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "Horse.h" @@ -89,22 +90,6 @@ void cHorse::Tick(float a_Dt, cChunk & a_Chunk) void cHorse::OnRightClicked(cPlayer & a_Player) { - if (m_Attachee != NULL) - { - if (m_Attachee->GetUniqueID() == a_Player.GetUniqueID()) - { - a_Player.Detach(); - return; - } - - if (m_Attachee->IsPlayer()) - { - return; - } - - m_Attachee->Detach(); - } - if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_SADDLE) && (!m_bIsSaddled) && (m_bIsTame)) { if (!a_Player.IsGameModeCreative()) @@ -123,6 +108,22 @@ void cHorse::OnRightClicked(cPlayer & a_Player) } else { + if (m_Attachee != NULL) + { + if (m_Attachee->GetUniqueID() == a_Player.GetUniqueID()) + { + a_Player.Detach(); + return; + } + + if (m_Attachee->IsPlayer()) + { + return; + } + + m_Attachee->Detach(); + } + m_TameAttemptTimes++; a_Player.AttachTo(this); } |