diff options
author | mborland <matt.borland1@gmail.com> | 2013-11-11 00:33:58 +0100 |
---|---|---|
committer | mborland <matt.borland1@gmail.com> | 2013-11-11 00:33:58 +0100 |
commit | 3710d423acba9546adf441782eb6a17a081c9320 (patch) | |
tree | 9ad19a165d324101fd3c8a3c42665d397d77ee08 /source/Mobs/Sheep.cpp | |
parent | VC2013 (diff) | |
parent | Fixed cRoot::FindAndDoWithPlayer(). (diff) | |
download | cuberite-3710d423acba9546adf441782eb6a17a081c9320.tar cuberite-3710d423acba9546adf441782eb6a17a081c9320.tar.gz cuberite-3710d423acba9546adf441782eb6a17a081c9320.tar.bz2 cuberite-3710d423acba9546adf441782eb6a17a081c9320.tar.lz cuberite-3710d423acba9546adf441782eb6a17a081c9320.tar.xz cuberite-3710d423acba9546adf441782eb6a17a081c9320.tar.zst cuberite-3710d423acba9546adf441782eb6a17a081c9320.zip |
Diffstat (limited to 'source/Mobs/Sheep.cpp')
-rw-r--r-- | source/Mobs/Sheep.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/source/Mobs/Sheep.cpp b/source/Mobs/Sheep.cpp index 703482ddb..bda4ccff8 100644 --- a/source/Mobs/Sheep.cpp +++ b/source/Mobs/Sheep.cpp @@ -33,7 +33,6 @@ void cSheep::GetDrops(cItems & a_Drops, cEntity * a_Killer) - void cSheep::OnRightClicked(cPlayer & a_Player) { if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_SHEARS) && (!m_IsSheared)) @@ -51,9 +50,13 @@ void cSheep::OnRightClicked(cPlayer & a_Player) Drops.push_back(cItem(E_BLOCK_WOOL, NumDrops, m_WoolColor)); m_World->SpawnItemPickups(Drops, GetPosX(), GetPosY(), GetPosZ(), 10); } + if ((a_Player.GetEquippedItem().m_ItemType == E_ITEM_DYE) && (m_WoolColor != 15 - a_Player.GetEquippedItem().m_ItemDamage)) + { + m_WoolColor = 15 - a_Player.GetEquippedItem().m_ItemDamage; + if (!a_Player.IsGameModeCreative()) + { + a_Player.GetInventory().RemoveOneEquippedItem(); + } + m_World->BroadcastEntityMetadata(*this); + } } - - - - - |