mirror of
https://github.com/cuberite/cuberite.git
synced 2025-01-09 04:19:26 +08:00
Make SetAllData's MarkDirty() the chunk's responsibility
This commit is contained in:
parent
9fcd2d4210
commit
60bc040a9c
@ -352,6 +352,11 @@ void cChunk::SetAllData(cSetChunkData & a_SetChunkData)
|
||||
// Set the chunk data as valid. This may be needed for some simulators that perform actions upon block adding (Vaporize)
|
||||
SetPresence(cpPresent);
|
||||
|
||||
if (a_SetChunkData.ShouldMarkDirty())
|
||||
{
|
||||
MarkDirty();
|
||||
}
|
||||
|
||||
// Wake up all simulators for their respective blocks:
|
||||
WakeUpSimulators();
|
||||
|
||||
@ -371,9 +376,9 @@ void cChunk::SetLight(
|
||||
// Postponing until we see how bad it is :)
|
||||
|
||||
m_ChunkData.SetBlockLight(a_BlockLight);
|
||||
|
||||
m_ChunkData.SetSkyLight(a_SkyLight);
|
||||
|
||||
MarkDirty();
|
||||
m_IsLightValid = true;
|
||||
}
|
||||
|
||||
|
@ -245,11 +245,6 @@ void cChunkMap::SetChunkData(cSetChunkData & a_SetChunkData)
|
||||
ASSERT(Chunk != nullptr); // Chunk cannot have unloaded since it is marked as queued
|
||||
Chunk->SetAllData(a_SetChunkData);
|
||||
|
||||
if (a_SetChunkData.ShouldMarkDirty())
|
||||
{
|
||||
Chunk->MarkDirty();
|
||||
}
|
||||
|
||||
// Notify relevant ChunkStays:
|
||||
cChunkStays ToBeDisabled;
|
||||
for (cChunkStays::iterator itr = m_ChunkStays.begin(), end = m_ChunkStays.end(); itr != end; ++itr)
|
||||
@ -290,7 +285,6 @@ void cChunkMap::ChunkLighted(
|
||||
return;
|
||||
}
|
||||
Chunk->SetLight(a_BlockLight, a_SkyLight);
|
||||
Chunk->MarkDirty();
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user