summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Items/ItemHandler.cpp')
-rw-r--r--src/Items/ItemHandler.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index 621cf9501..dddd67cdd 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -72,7 +72,7 @@ cItemHandler * cItemHandler::m_ItemHandler[2268];
cItemHandler * cItemHandler::GetItemHandler(int a_ItemType)
{
- if ((a_ItemType < 0) || ((size_t)a_ItemType >= ARRAYCOUNT(m_ItemHandler)))
+ if ((a_ItemType < 0) || (static_cast<size_t>(a_ItemType) >= ARRAYCOUNT(m_ItemHandler)))
{
// Either nothing (-1), or bad value, both cases should return the air handler
if (a_ItemType < -1)
@@ -287,7 +287,7 @@ cItemHandler * cItemHandler::CreateItemHandler(int a_ItemType)
void cItemHandler::Deinit()
{
- for (int i = 0; i < 2267; i++)
+ for (size_t i = 0; i < ARRAYCOUNT(m_ItemHandler); i++)
{
delete m_ItemHandler[i];
m_ItemHandler[i] = nullptr;
@@ -336,7 +336,7 @@ bool cItemHandler::OnPlayerPlace(
if (
BlockHandler(ClickedBlock)->DoesIgnoreBuildCollision() ||
BlockHandler(ClickedBlock)->DoesIgnoreBuildCollision(&a_Player, ClickedBlockMeta)
- )
+ )
{
cChunkInterface ChunkInterface(a_World.GetChunkMap());
BlockHandler(ClickedBlock)->OnDestroyedByPlayer(ChunkInterface, a_World, &a_Player, a_BlockX, a_BlockY, a_BlockZ);
@@ -411,15 +411,19 @@ bool cItemHandler::OnPlayerPlace(
-bool cItemHandler::OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_Dir)
+bool cItemHandler::OnItemUse(
+ cWorld * a_World, cPlayer * a_Player, cBlockPluginInterface & a_PluginInterface, const cItem & a_Item,
+ int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace
+)
{
UNUSED(a_World);
UNUSED(a_Player);
+ UNUSED(a_PluginInterface);
UNUSED(a_Item);
UNUSED(a_BlockX);
UNUSED(a_BlockY);
UNUSED(a_BlockZ);
- UNUSED(a_Dir);
+ UNUSED(a_BlockFace);
return false;
}
@@ -753,7 +757,7 @@ bool cItemHandler::GetPlacementBlockTypeMeta(
return false;
}
- cBlockHandler * BlockH = BlockHandler((BLOCKTYPE)m_ItemType);
+ cBlockHandler * BlockH = BlockHandler(static_cast<BLOCKTYPE>(m_ItemType));
cChunkInterface ChunkInterface(a_World->GetChunkMap());
return BlockH->GetPlacementBlockTypeMeta(
ChunkInterface, a_Player,