diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-05-27 19:28:42 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-05-27 19:28:42 +0200 |
commit | 9b8dff31e6140cab7ea44ae219771ad6a043c62e (patch) | |
tree | 9e2c7d14fef7b933fdc8f7929f59eeb5ee979274 /source/Simulator/RedstoneSimulator.cpp | |
parent | Fixed cItemGrid API, no more changeable GetSlot(). (diff) | |
download | cuberite-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.cpp | 24 |
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); } } } |