summaryrefslogtreecommitdiffstats
path: root/src/Simulator/IncrementalRedstoneSimulator/CommandBlockHandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Simulator/IncrementalRedstoneSimulator/CommandBlockHandler.h')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator/CommandBlockHandler.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator/CommandBlockHandler.h b/src/Simulator/IncrementalRedstoneSimulator/CommandBlockHandler.h
index c216d12bc..0a5ffe136 100644
--- a/src/Simulator/IncrementalRedstoneSimulator/CommandBlockHandler.h
+++ b/src/Simulator/IncrementalRedstoneSimulator/CommandBlockHandler.h
@@ -31,9 +31,14 @@ namespace CommandBlockHandler
return;
}
- a_Chunk.DoWithCommandBlockAt(a_Position, [](cCommandBlockEntity & a_CommandBlock)
+ a_Chunk.DoWithBlockEntityAt(a_Position, [](cBlockEntity & a_BlockEntity)
{
- a_CommandBlock.Activate();
+ if (a_BlockEntity.GetBlockType() != E_BLOCK_COMMAND_BLOCK)
+ {
+ return false;
+ }
+
+ static_cast<cCommandBlockEntity &>(a_BlockEntity).Activate();
return false;
});
}