summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authortonibm19 <tonibm19@gmail.com>2013-11-10 17:05:19 +0100
committertonibm19 <tonibm19@gmail.com>2013-11-10 17:05:19 +0100
commit4af5868322757b892d976d9549633f40f0e7eeb4 (patch)
treeca0450d425b4bfde0625a2b0c72568c9d9ef17fd /source
parentSTR_Warrior was right. (diff)
downloadcuberite-4af5868322757b892d976d9549633f40f0e7eeb4.tar
cuberite-4af5868322757b892d976d9549633f40f0e7eeb4.tar.gz
cuberite-4af5868322757b892d976d9549633f40f0e7eeb4.tar.bz2
cuberite-4af5868322757b892d976d9549633f40f0e7eeb4.tar.lz
cuberite-4af5868322757b892d976d9549633f40f0e7eeb4.tar.xz
cuberite-4af5868322757b892d976d9549633f40f0e7eeb4.tar.zst
cuberite-4af5868322757b892d976d9549633f40f0e7eeb4.zip
Diffstat (limited to 'source')
-rw-r--r--source/Mobs/Sheep.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/Mobs/Sheep.cpp b/source/Mobs/Sheep.cpp
index e8d0be2ae..bda4ccff8 100644
--- a/source/Mobs/Sheep.cpp
+++ b/source/Mobs/Sheep.cpp
@@ -1,3 +1,4 @@
+
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "Sheep.h"
@@ -49,8 +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)
+ 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);
}
}