summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Sheep.cpp
diff options
context:
space:
mode:
authorjfhumann <j.f.humann@gmail.com>2014-04-18 21:09:44 +0200
committerjfhumann <j.f.humann@gmail.com>2014-04-18 21:09:44 +0200
commit013da806ec20b62a742aded9a9d2b8131193f30d (patch)
treebfe1f833f93cd4a57619fa149f5f9075a28862e2 /src/Mobs/Sheep.cpp
parentProtoProxy: Added 1.7.9 compatibility. (diff)
downloadcuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar.gz
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar.bz2
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar.lz
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar.xz
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar.zst
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.zip
Diffstat (limited to 'src/Mobs/Sheep.cpp')
-rw-r--r--src/Mobs/Sheep.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Mobs/Sheep.cpp b/src/Mobs/Sheep.cpp
index c64360153..b3d4d93c1 100644
--- a/src/Mobs/Sheep.cpp
+++ b/src/Mobs/Sheep.cpp
@@ -36,7 +36,8 @@ 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))
+ const cItem & EquippedItem = a_Player.GetEquippedItem();
+ if ((EquippedItem.m_ItemType == E_ITEM_SHEARS) && (!m_IsSheared))
{
m_IsSheared = true;
m_World->BroadcastEntityMetadata(*this);
@@ -51,9 +52,9 @@ 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))
+ else if ((EquippedItem.m_ItemType == E_ITEM_DYE) && (m_WoolColor != 15 - EquippedItem.m_ItemDamage))
{
- m_WoolColor = 15 - a_Player.GetEquippedItem().m_ItemDamage;
+ m_WoolColor = 15 - EquippedItem.m_ItemDamage;
if (!a_Player.IsGameModeCreative())
{
a_Player.GetInventory().RemoveOneEquippedItem();