From fd5191854df621402cfe1203daceb68851c88af7 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 28 Jul 2020 23:39:55 +0100 Subject: Delegate simulator wakeup to cChunk --- src/Blocks/BlockHandler.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp index 5d6609836..b7e746418 100644 --- a/src/Blocks/BlockHandler.cpp +++ b/src/Blocks/BlockHandler.cpp @@ -585,22 +585,18 @@ void cBlockHandler::Check( cChunk & a_Chunk ) { - if (!CanBeAt(a_ChunkInterface, a_RelPos, a_Chunk)) + if (CanBeAt(a_ChunkInterface, a_RelPos, a_Chunk)) { - if (DoesDropOnUnsuitable()) - { - a_ChunkInterface.DropBlockAsPickups(a_Chunk.RelativeToAbsolute(a_RelPos)); - } - else - { - a_Chunk.SetBlock(a_RelPos, E_BLOCK_AIR, 0); - } + return; + } + + if (DoesDropOnUnsuitable()) + { + a_ChunkInterface.DropBlockAsPickups(a_Chunk.RelativeToAbsolute(a_RelPos)); } else { - // Wake up the simulators for this block: - auto absPos = a_Chunk.RelativeToAbsolute(a_RelPos); - a_Chunk.GetWorld()->GetSimulatorManager()->WakeUp(absPos, &a_Chunk); + a_Chunk.SetBlock(a_RelPos, E_BLOCK_AIR, 0); } } -- cgit v1.2.3