summaryrefslogtreecommitdiffstats
path: root/source/Simulator/RedstoneSimulator.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-27 19:28:42 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-27 19:28:42 +0200
commit9b8dff31e6140cab7ea44ae219771ad6a043c62e (patch)
tree9e2c7d14fef7b933fdc8f7929f59eeb5ee979274 /source/Simulator/RedstoneSimulator.cpp
parentFixed cItemGrid API, no more changeable GetSlot(). (diff)
downloadcuberite-9b8dff31e6140cab7ea44ae219771ad6a043c62e.tar
cuberite-9b8dff31e6140cab7ea44ae219771ad6a043c62e.tar.gz
cuberite-9b8dff31e6140cab7ea44ae219771ad6a043c62e.tar.bz2
cuberite-9b8dff31e6140cab7ea44ae219771ad6a043c62e.tar.lz
cuberite-9b8dff31e6140cab7ea44ae219771ad6a043c62e.tar.xz
cuberite-9b8dff31e6140cab7ea44ae219771ad6a043c62e.tar.zst
cuberite-9b8dff31e6140cab7ea44ae219771ad6a043c62e.zip
Diffstat (limited to 'source/Simulator/RedstoneSimulator.cpp')
-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);
}
}
}