From 8147ccd13be96e8d4bec2aae33b8cc8ee84c5866 Mon Sep 17 00:00:00 2001 From: tonibm19 Date: Tue, 15 Oct 2013 17:09:43 +0200 Subject: Added horse saddling It uses pig code, sorry if it don't works, i'm a noob, but it should work. --- source/Mobs/Horse.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source/Mobs/Horse.cpp') diff --git a/source/Mobs/Horse.cpp b/source/Mobs/Horse.cpp index 46e7969cc..1f2c28adf 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" @@ -107,6 +106,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); + } } -- cgit v1.2.3