Use the ItemCategorie::IsSword() Method.
This commit is contained in:
parent
cc34898e45
commit
084971424f
@ -797,7 +797,7 @@ void cClientHandle::HandleBlockDigStarted(int a_BlockX, int a_BlockY, int a_Bloc
|
||||
|
||||
if (
|
||||
m_Player->IsGameModeCreative() &&
|
||||
cItemSwordHandler::IsSword(m_Player->GetInventory().GetEquippedItem().m_ItemType)
|
||||
ItemCategory::IsSword(m_Player->GetInventory().GetEquippedItem().m_ItemType)
|
||||
)
|
||||
{
|
||||
// Players can't destroy blocks with a Sword in the hand.
|
||||
|
@ -23,25 +23,6 @@ public:
|
||||
{
|
||||
return (a_BlockType == E_BLOCK_COBWEB);
|
||||
}
|
||||
|
||||
inline static bool IsSword(int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case E_ITEM_WOODEN_SWORD:
|
||||
case E_ITEM_STONE_SWORD:
|
||||
case E_ITEM_IRON_SWORD:
|
||||
case E_ITEM_GOLD_SWORD:
|
||||
case E_ITEM_DIAMOND_SWORD:
|
||||
{
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user