diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-07-29 01:12:45 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-08-02 16:52:06 +0200 |
commit | 99856df6869d32731e6fdcfeb1460297410f5820 (patch) | |
tree | c93afdb7dac377ff6c04732190a3efbe3a091c4b /src/Simulator/Simulator.cpp | |
parent | Do not impose redstone wakup penalty for all blocks (diff) | |
download | cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.gz cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.bz2 cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.lz cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.xz cuberite-99856df6869d32731e6fdcfeb1460297410f5820.tar.zst cuberite-99856df6869d32731e6fdcfeb1460297410f5820.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Simulator/Simulator.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/Simulator/Simulator.cpp b/src/Simulator/Simulator.cpp index ac2e757e4..e55b77f0f 100644 --- a/src/Simulator/Simulator.cpp +++ b/src/Simulator/Simulator.cpp @@ -1,33 +1,38 @@ #include "Globals.h" -#include "../World.h" -#include "../Defines.h" +#include "Simulator.h" #include "../Chunk.h" #include "../Cuboid.h" +#include "../World.h" -#ifdef __clang__ - #pragma clang diagnostic ignored "-Wweak-template-vtables" -#endif // __clang__ -#include "Simulator.h" +void cSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position, BLOCKTYPE a_Block) +{ + ASSERT(a_Chunk.IsValid()); + + AddBlock(a_Chunk, a_Position, a_Block); +} -void cSimulator::WakeUp(Vector3i a_Block, cChunk * a_Chunk) + +void cSimulator::WakeUp(cChunk & a_Chunk, Vector3i a_Position, Vector3i a_Offset, BLOCKTYPE a_Block) { - AddBlock(a_Block, a_Chunk); + ASSERT(a_Chunk.IsValid()); + + WakeUp(a_Chunk, a_Position, a_Block); } -void cSimulator::WakeUpArea(const cCuboid & a_Area) +void cSimulator::WakeUp(const cCuboid & a_Area) { cCuboid area(a_Area); area.Sort(); @@ -60,7 +65,8 @@ void cSimulator::WakeUpArea(const cCuboid & a_Area) { for (int x = startX; x <= endX; ++x) { - AddBlock({x, y, z}, &a_CBChunk); + const auto Position = cChunkDef::AbsoluteToRelative({ x, y, z }); + AddBlock(a_CBChunk, Position, a_CBChunk.GetBlock(Position)); } // for x } // for z } // for y @@ -70,7 +76,3 @@ void cSimulator::WakeUpArea(const cCuboid & a_Area) } // for cx } // for cz } - - - - |