summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/TripwireHookHandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/TripwireHookHandler.h')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/TripwireHookHandler.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/TripwireHookHandler.h b/src/Simulator/IncrementalRedstoneSimulator/TripwireHookHandler.h
index 2fb85f58c..85c05430c 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/TripwireHookHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/TripwireHookHandler.h
@@ -39,7 +39,26 @@ public:
if (Type == E_BLOCK_TRIPWIRE)
{
- if (!a_World.ForEachEntityInBox(cBoundingBox(Vector3d(0.5, 0, 0.5) + Position, 0.5, 0.5), [](cEntity &) { return true; }))
+ class cTripwireCallback :
+ public cEntityCallback
+ {
+ public:
+ cTripwireCallback(void) :
+ m_NumberOfEntities(0),
+ m_FoundPlayer(false)
+ {
+ }
+
+ virtual bool Item(cEntity * a_Entity) override
+ {
+ return true;
+ }
+
+ unsigned int m_NumberOfEntities;
+ bool m_FoundPlayer;
+ } TripwireCallback;
+
+ if (!a_World.ForEachEntityInBox(cBoundingBox(Vector3d(0.5, 0, 0.5) + Position, 0.5, 0.5), TripwireCallback))
{
FoundActivated = true;
}