summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator
diff options
context:
space:
mode:
authorEthan Jones <ethan@yasfu.net>2021-09-15 19:33:18 +0200
committerGitHub <noreply@github.com>2021-09-15 19:33:18 +0200
commitaf93c297f4e18fced161250403de8f737558ad3b (patch)
treea2559ceb4ffbd452ac160d4234a6ab5c85c049e6 /src/Simulator/IncrementalRedstoneSimulator
parentCMake MinGW bug - https://gitlab.kitware.com/cmake/cmake/-/issues/5939 (#5295) (diff)
downloadcuberite-af93c297f4e18fced161250403de8f737558ad3b.tar
cuberite-af93c297f4e18fced161250403de8f737558ad3b.tar.gz
cuberite-af93c297f4e18fced161250403de8f737558ad3b.tar.bz2
cuberite-af93c297f4e18fced161250403de8f737558ad3b.tar.lz
cuberite-af93c297f4e18fced161250403de8f737558ad3b.tar.xz
cuberite-af93c297f4e18fced161250403de8f737558ad3b.tar.zst
cuberite-af93c297f4e18fced161250403de8f737558ad3b.zip
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h b/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h
index 7e377df68..003b5b253 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/PressurePlateHandler.h
@@ -17,17 +17,29 @@ namespace PressurePlateHandler
Chunk.ForEachEntityInBox(cBoundingBox(Vector3d(0.5, 0, 0.5) + Position, 0.5, 0.5), [&](cEntity & Entity)
{
+ if (Entity.GetHealth() <= 0)
+ {
+ return false;
+ }
+
if (Entity.IsPlayer())
{
+ const auto & Player = static_cast<cPlayer &>(Entity);
+
+ if (Player.IsGameModeSpectator())
+ {
+ return false;
+ }
+
FoundPlayer = true;
}
-
- if (Entity.IsPickup())
+ else if (Entity.IsPickup())
{
const auto & Pickup = static_cast<cPickup &>(Entity);
NumberOfEntities += static_cast<size_t>(Pickup.GetItem().m_ItemCount);
return false;
}
+
NumberOfEntities++;
return false;
});