1
0

ChunkMap: do not wantonly make empty chunks

- Removed calls that constructed an empty chunk, found it was invalid, and did nothing with said chunk

Partially addresses #2324
This commit is contained in:
Tiger Wang
2020-08-28 21:22:44 +01:00
parent b084f1f13f
commit 72ae5ecb5a
5 changed files with 133 additions and 245 deletions

View File

@@ -132,13 +132,6 @@ void cSimulator::WakeUp(const cCuboid & a_Area)
{
m_World.DoWithChunk(cx, cz, [this, &area](cChunk & a_CBChunk) -> bool
{
if (!a_CBChunk.IsValid())
{
LOGWARNING("%s: Trying to wake up inside a non-valid chunk [%d, %d]. Ignoring.",
__FUNCTION__, a_CBChunk.GetPosX(), a_CBChunk.GetPosZ()
);
return true;
}
int startX = std::max(area.p1.x, a_CBChunk.GetPosX() * cChunkDef::Width);
int startZ = std::max(area.p1.z, a_CBChunk.GetPosZ() * cChunkDef::Width);
int endX = std::min(area.p2.x, a_CBChunk.GetPosX() * cChunkDef::Width + cChunkDef::Width - 1);