1
0

Fixes (SEE DESC)

Entity metadata is broadcasted.
If player is in survival, his equipped item is removed.
If you have green dye, and sheep is green, your equipped item won't be removed.
This commit is contained in:
tonibm19 2013-11-10 17:05:19 +01:00
parent da5bd81836
commit 4af5868322

View File

@ -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);
}
}