summaryrefslogtreecommitdiffstats
path: root/source/Simulator/RedstoneSimulator.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/Simulator/RedstoneSimulator.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/source/Simulator/RedstoneSimulator.cpp b/source/Simulator/RedstoneSimulator.cpp
index 03ad43ace..5db40192f 100644
--- a/source/Simulator/RedstoneSimulator.cpp
+++ b/source/Simulator/RedstoneSimulator.cpp
@@ -433,20 +433,20 @@ void cRedstoneSimulator::HandleChange(const Vector3i & a_BlockPos)
BLOCKTYPE BlockType = m_World.GetBlock(pos);
if ((BlockType == E_BLOCK_DISPENSER) || (BlockType == E_BLOCK_DROPPER))
{
- if (IsPowered(pos))
+ class cSetPowerToDropSpenser :
+ public cDropSpenserCallback
{
- class cActivateDropSpenser :
- public cDropSpenserCallback
+ bool m_IsPowered;
+ public:
+ cSetPowerToDropSpenser(bool a_IsPowered) : m_IsPowered(a_IsPowered) {}
+
+ virtual bool Item(cDropSpenserEntity * a_DropSpenser) override
{
- virtual bool Item(cDropSpenserEntity * a_DropSpenser) override
- {
- a_DropSpenser->Activate();
- return false;
- }
- } ;
- cActivateDropSpenser DrSpAct;
- m_World.DoWithDropSpenserAt(pos.x, pos.y, pos.z, DrSpAct);
- }
+ a_DropSpenser->Activate();
+ return false;
+ }
+ } DrSpSP(IsPowered(pos));
+ m_World.DoWithDropSpenserAt(pos.x, pos.y, pos.z, DrSpSP);
}
}
}