Rewritten Lua ChunkStay API into a single function, cWorld:ChunkStay().
This fixes problems with indeterminate class object lifespan (Lua-GC) and forgetting to disable it or keep it until ready.
This commit is contained in:
@@ -548,9 +548,21 @@ cLightingThread::cLightingChunkStay::cLightingChunkStay(cLightingThread & a_Ligh
|
||||
|
||||
|
||||
|
||||
void cLightingThread::cLightingChunkStay::OnAllChunksAvailable(void)
|
||||
bool cLightingThread::cLightingChunkStay::OnAllChunksAvailable(void)
|
||||
{
|
||||
m_LightingThread.QueueChunkStay(*this);
|
||||
|
||||
// Keep the ChunkStay alive:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cLightingThread::cLightingChunkStay::OnDisabled(void)
|
||||
{
|
||||
// Nothing needed in this callback
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user