summaryrefslogtreecommitdiffstats
path: root/source/Mobs/Horse.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2013-10-15 18:39:16 +0200
committerAlexander Harkness <bearbin@gmail.com>2013-10-15 18:39:16 +0200
commit9376005778494f7f34cf6a656ac0f2e6966e86e1 (patch)
tree6ad83c006521d648fa6f1df99bec47709c9f9dc6 /source/Mobs/Horse.cpp
parentAPIDump: Documented HOOK_SPAWNING_MONSTER. (diff)
parentFixed a big fail.I did (diff)
downloadcuberite-9376005778494f7f34cf6a656ac0f2e6966e86e1.tar
cuberite-9376005778494f7f34cf6a656ac0f2e6966e86e1.tar.gz
cuberite-9376005778494f7f34cf6a656ac0f2e6966e86e1.tar.bz2
cuberite-9376005778494f7f34cf6a656ac0f2e6966e86e1.tar.lz
cuberite-9376005778494f7f34cf6a656ac0f2e6966e86e1.tar.xz
cuberite-9376005778494f7f34cf6a656ac0f2e6966e86e1.tar.zst
cuberite-9376005778494f7f34cf6a656ac0f2e6966e86e1.zip
Diffstat (limited to 'source/Mobs/Horse.cpp')
-rw-r--r--source/Mobs/Horse.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/Mobs/Horse.cpp b/source/Mobs/Horse.cpp
index 46e7969cc..c2a8f6ed0 100644
--- a/source/Mobs/Horse.cpp
+++ b/source/Mobs/Horse.cpp
@@ -107,6 +107,18 @@ void cHorse::OnRightClicked(cPlayer & a_Player)
m_TameAttemptTimes++;
a_Player.AttachTo(this);
+
+ 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);
+ }
}