summaryrefslogtreecommitdiffstats
path: root/src/Simulator
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-10-05 14:09:42 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-12-18 22:03:40 +0100
commit090d8305e4e3c3ee085a897b72f2b4708e183eb8 (patch)
treee703cc7fcb7f16c85f16b094d5df0bd0a8d698e8 /src/Simulator
parentHorsies: don't always broadcast metadata (diff)
downloadcuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.gz
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.bz2
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.lz
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.xz
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.tar.zst
cuberite-090d8305e4e3c3ee085a897b72f2b4708e183eb8.zip
Diffstat (limited to 'src/Simulator')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h b/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h
index 46409b101..fb78b9b57 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h
@@ -12,7 +12,7 @@ namespace PressurePlateHandler
{
inline unsigned char GetPowerLevel(const cChunk & Chunk, const Vector3i Position, const BLOCKTYPE BlockType)
{
- Int64 NumberOfEntities = 0;
+ size_t NumberOfEntities = 0;
bool FoundPlayer = false;
Chunk.ForEachEntityInBox(cBoundingBox(Vector3d(0.5, 0, 0.5) + Position, 0.5, 0.5), [&](cEntity & Entity)
@@ -24,7 +24,8 @@ namespace PressurePlateHandler
if (Entity.IsPickup())
{
- NumberOfEntities += static_cast<cPickup &>(Entity).GetItem().m_ItemCount;
+ const auto & Pickup = static_cast<cPickup &>(Entity);
+ NumberOfEntities += static_cast<size_t>(Pickup.GetItem().m_ItemCount);
return false;
}
NumberOfEntities++;
@@ -35,11 +36,11 @@ namespace PressurePlateHandler
{
case E_BLOCK_STONE_PRESSURE_PLATE:
{
- return (FoundPlayer ? 15 : 0);
+ return FoundPlayer ? 15 : 0;
}
case E_BLOCK_WOODEN_PRESSURE_PLATE:
{
- return (NumberOfEntities > 0 ? 15 : 0);
+ return (NumberOfEntities != 0) ? 15 : 0;
}
case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE:
{