From 9b8dff31e6140cab7ea44ae219771ad6a043c62e Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 27 May 2013 17:28:42 +0000 Subject: DropSpensers: Fixed activation when receiving redstone signal. Now only one item is dropspensed. Fix for FS #378, http://www.mc-server.org/support/index.php?do=details&task_id=378 git-svn-id: http://mc-server.googlecode.com/svn/trunk@1521 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Simulator/RedstoneSimulator.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'source/Simulator') 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); } } } -- cgit v1.2.3