summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/DropSpenserEntity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/BlockEntities/DropSpenserEntity.cpp')
-rw-r--r--src/BlockEntities/DropSpenserEntity.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/BlockEntities/DropSpenserEntity.cpp b/src/BlockEntities/DropSpenserEntity.cpp
index b067e1081..6c0df0606 100644
--- a/src/BlockEntities/DropSpenserEntity.cpp
+++ b/src/BlockEntities/DropSpenserEntity.cpp
@@ -47,8 +47,8 @@ void cDropSpenserEntity::AddDropSpenserDir(Vector3i & a_RelCoord, NIBBLETYPE a_D
void cDropSpenserEntity::DropSpense(cChunk & a_Chunk)
{
// Pick one of the occupied slots:
- int OccupiedSlots[9];
- int SlotsCnt = 0;
+ std::array<int, 9> OccupiedSlots;
+ size_t SlotsCnt = 0;
for (int i = m_Contents.GetNumSlots() - 1; i >= 0; i--)
{
if (!m_Contents.GetSlot(i).IsEmpty())
@@ -65,7 +65,7 @@ void cDropSpenserEntity::DropSpense(cChunk & a_Chunk)
return;
}
- const int RandomSlot = m_World->GetTickRandomNumber(SlotsCnt - 1);
+ const size_t RandomSlot = GetRandomProvider().RandInt(SlotsCnt - 1);
const int SpenseSlot = OccupiedSlots[RandomSlot];
if (cPluginManager::Get()->CallHookDropSpense(*m_World, *this, SpenseSlot))