diff options
author | Mattes D <github@xoft.cz> | 2013-11-10 22:04:27 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2013-11-10 22:04:27 +0100 |
commit | 3a692d53e87557743ceb3ada6a1ae0d0538fd7de (patch) | |
tree | 0ff5a29c25a861268c0b1dbbc703bd1bcdc5fa95 | |
parent | Removed #include "../Root.h" since it isn't needed. (diff) | |
parent | Fixes (SEE DESC) (diff) | |
download | cuberite-3a692d53e87557743ceb3ada6a1ae0d0538fd7de.tar cuberite-3a692d53e87557743ceb3ada6a1ae0d0538fd7de.tar.gz cuberite-3a692d53e87557743ceb3ada6a1ae0d0538fd7de.tar.bz2 cuberite-3a692d53e87557743ceb3ada6a1ae0d0538fd7de.tar.lz cuberite-3a692d53e87557743ceb3ada6a1ae0d0538fd7de.tar.xz cuberite-3a692d53e87557743ceb3ada6a1ae0d0538fd7de.tar.zst cuberite-3a692d53e87557743ceb3ada6a1ae0d0538fd7de.zip |
Diffstat (limited to '')
-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); + } } - - - - - |