diff options
author | Alexander Harkness <bearbin@gmail.com> | 2013-10-15 18:39:16 +0200 |
---|---|---|
committer | Alexander Harkness <bearbin@gmail.com> | 2013-10-15 18:39:16 +0200 |
commit | 9376005778494f7f34cf6a656ac0f2e6966e86e1 (patch) | |
tree | 6ad83c006521d648fa6f1df99bec47709c9f9dc6 /source/Mobs/Horse.cpp | |
parent | APIDump: Documented HOOK_SPAWNING_MONSTER. (diff) | |
parent | Fixed a big fail.I did (diff) | |
download | cuberite-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.cpp | 12 |
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); + } } |