Delegate simulator wakeup to cChunk
This commit is contained in:
parent
6c47f46c31
commit
fd5191854d
@ -585,22 +585,18 @@ void cBlockHandler::Check(
|
|||||||
cChunk & a_Chunk
|
cChunk & a_Chunk
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (!CanBeAt(a_ChunkInterface, a_RelPos, a_Chunk))
|
if (CanBeAt(a_ChunkInterface, a_RelPos, a_Chunk))
|
||||||
{
|
{
|
||||||
if (DoesDropOnUnsuitable())
|
return;
|
||||||
{
|
}
|
||||||
a_ChunkInterface.DropBlockAsPickups(a_Chunk.RelativeToAbsolute(a_RelPos));
|
|
||||||
}
|
if (DoesDropOnUnsuitable())
|
||||||
else
|
{
|
||||||
{
|
a_ChunkInterface.DropBlockAsPickups(a_Chunk.RelativeToAbsolute(a_RelPos));
|
||||||
a_Chunk.SetBlock(a_RelPos, E_BLOCK_AIR, 0);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Wake up the simulators for this block:
|
a_Chunk.SetBlock(a_RelPos, E_BLOCK_AIR, 0);
|
||||||
auto absPos = a_Chunk.RelativeToAbsolute(a_RelPos);
|
|
||||||
a_Chunk.GetWorld()->GetSimulatorManager()->WakeUp(absPos, &a_Chunk);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1314,6 +1314,10 @@ void cChunk::SetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_Blo
|
|||||||
m_ToTickBlocks.push_back(a_RelPos);
|
m_ToTickBlocks.push_back(a_RelPos);
|
||||||
QueueTickBlockNeighbors(a_RelPos);
|
QueueTickBlockNeighbors(a_RelPos);
|
||||||
|
|
||||||
|
// TODO: use relative coordinates, cChunk reference
|
||||||
|
// Wake up the simulators for this block:
|
||||||
|
GetWorld()->GetSimulatorManager()->WakeUp(RelativeToAbsolute(a_RelPos), this);
|
||||||
|
|
||||||
// If there was a block entity, remove it:
|
// If there was a block entity, remove it:
|
||||||
cBlockEntity * BlockEntity = GetBlockEntityRel(a_RelPos);
|
cBlockEntity * BlockEntity = GetBlockEntityRel(a_RelPos);
|
||||||
if (BlockEntity != nullptr)
|
if (BlockEntity != nullptr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user