From 9da404ea2db52dd4a5d9d0a5ca1736fd7e2e10bf Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 4 Oct 2015 14:06:37 +0200 Subject: Fixed a race condition between chunk loader and generator. When using ChunkWorx to generate multiple chunks, the server would sometimes fail an assert because it would generate a chunk even when it was successfully loaded. This was caused by chunks queued in cWorld's m_SetChunkDataQueue and thus being marked as "InQueue" although they were already loaded. Solved by adding a new parameter to chunk coord callbacks specifying whether the operation succeeded or failed, and using that instead of the chunk presence flag to decide whether to generate or not. --- src/SpawnPrepare.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/SpawnPrepare.cpp') diff --git a/src/SpawnPrepare.cpp b/src/SpawnPrepare.cpp index 74dcb3ecd..e332d3b1a 100644 --- a/src/SpawnPrepare.cpp +++ b/src/SpawnPrepare.cpp @@ -20,7 +20,7 @@ protected: cSpawnPrepare & m_SpawnPrepare; - virtual void Call(int a_ChunkX, int a_ChunkZ) override + virtual void Call(int a_ChunkX, int a_ChunkZ, bool a_IsSuccess) override { m_SpawnPrepare.PreparedChunkCallback(a_ChunkX, a_ChunkZ); } -- cgit v1.2.3