1
0

Added a_Digger check

This commit is contained in:
Jaume Aloy 2014-08-30 00:27:33 +02:00
parent 7d771953c0
commit 4900645b28
2 changed files with 33 additions and 30 deletions

View File

@ -433,6 +433,8 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac
else
{
// TODO: Add a proper overridable function for this
if (a_Digger != NULL)
{
cEnchantments Enchantments = a_Digger->GetEquippedWeapon().m_Enchantments;
if ((Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0) && a_Digger->IsPlayer())
{
@ -468,6 +470,7 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac
}
}
}
}
// Allow plugins to modify the pickups:
a_BlockPluginInterface.CallHookBlockToPickups(a_Digger, a_BlockX, a_BlockY, a_BlockZ, m_BlockType, Meta, Pickups);

View File

@ -400,7 +400,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
for (size_t i = 0; i < ARRAYCOUNT(ArmorItems); i++)
{
cItem Item = ArmorItems[i];
if (Item.m_Enchantments.GetLevel(cEnchantments::enchThorns) > ThornsLevel) ThornsLevel = Item.m_Enchantments.GetLevel(cEnchantments::enchThorns);
ThornsLevel = std::max(ThornsLevel, Item.m_Enchantments.GetLevel(cEnchantments::enchThorns));
}
if (ThornsLevel > 0)