From adb86a75dac91a210149fc28b1dbf5225896f66c Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 29 Jul 2020 20:15:09 +0100 Subject: Do not GetBlock individually in simulators * Have the simulator manager get the block and pass it on + Add new overload for WakeUp, called when the manager wakes face positions --- src/Simulator/DelayedFluidSimulator.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/Simulator/DelayedFluidSimulator.cpp') diff --git a/src/Simulator/DelayedFluidSimulator.cpp b/src/Simulator/DelayedFluidSimulator.cpp index b27e34e5f..ec1918617 100644 --- a/src/Simulator/DelayedFluidSimulator.cpp +++ b/src/Simulator/DelayedFluidSimulator.cpp @@ -78,21 +78,6 @@ cDelayedFluidSimulator::cDelayedFluidSimulator(cWorld & a_World, BLOCKTYPE a_Flu -void cDelayedFluidSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) -{ - if (!cChunkDef::IsValidHeight(a_Position.y)) - { - // Not inside the world (may happen when rclk with a full bucket - the client sends Y = -1) - return; - } - - Super::WakeUp(a_Chunk, a_Position, a_Block); -} - - - - - void cDelayedFluidSimulator::Simulate(float a_Dt) { m_AddSlotNum = m_SimSlotNum; @@ -153,3 +138,18 @@ void cDelayedFluidSimulator::AddBlock(cChunk & a_Chunk, Vector3i a_Position, BLO ++m_TotalBlocks; } + + + + + +void cDelayedFluidSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) +{ + if (!cChunkDef::IsValidHeight(a_Position.y)) + { + // Not inside the world (may happen when rclk with a full bucket - the client sends Y = -1) + return; + } + + AddBlock(a_Chunk, a_Position, a_Block); +} -- cgit v1.2.3