Added a_Digger check
This commit is contained in:
parent
7d771953c0
commit
4900645b28
@ -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);
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user