summaryrefslogtreecommitdiffstats
path: root/source/Mobs/Horse.cpp
diff options
context:
space:
mode:
authortonibm19 <tonibm19@gmail.com>2013-10-16 19:50:59 +0200
committertonibm19 <tonibm19@gmail.com>2013-10-16 19:50:59 +0200
commit137ed5a55660a9f436da972fa88e66149c5b5e49 (patch)
tree22ec1d78941624eef1fe15c0b30cc2888e4e94d1 /source/Mobs/Horse.cpp
parentAdded extra line (diff)
downloadcuberite-137ed5a55660a9f436da972fa88e66149c5b5e49.tar
cuberite-137ed5a55660a9f436da972fa88e66149c5b5e49.tar.gz
cuberite-137ed5a55660a9f436da972fa88e66149c5b5e49.tar.bz2
cuberite-137ed5a55660a9f436da972fa88e66149c5b5e49.tar.lz
cuberite-137ed5a55660a9f436da972fa88e66149c5b5e49.tar.xz
cuberite-137ed5a55660a9f436da972fa88e66149c5b5e49.tar.zst
cuberite-137ed5a55660a9f436da972fa88e66149c5b5e49.zip
Diffstat (limited to '')
-rw-r--r--source/Mobs/Horse.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/source/Mobs/Horse.cpp b/source/Mobs/Horse.cpp
index f1972ffc7..6876a5fa4 100644
--- a/source/Mobs/Horse.cpp
+++ b/source/Mobs/Horse.cpp
@@ -89,38 +89,38 @@ 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)
- {
- if (!a_Player.IsGameModeCreative())
- {
- a_Player.GetInventory().RemoveOneEquippedItem();
- }
-
- // Set saddle state & broadcast metadata
- m_bIsSaddled = true;
- m_World->BroadcastEntityMetadata(*this);
- }
- else
- {
- m_TameAttemptTimes++;
- a_Player.AttachTo(this);
- }
+ 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())
+ {
+ a_Player.GetInventory().RemoveOneEquippedItem();
+ }
+
+ // Set saddle state & broadcast metadata
+ m_bIsSaddled = true;
+ m_World->BroadcastEntityMetadata(*this);
+ }
+ else
+ {
+ m_TameAttemptTimes++;
+ a_Player.AttachTo(this);
+ }
}