From d4289eee3c0e282459ca0301efe15a475c6c5fda Mon Sep 17 00:00:00 2001 From: tycho Date: Sat, 19 Dec 2015 21:48:19 +0000 Subject: Fix race condition --- 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 9f1e645b1..ba9fc1117 100644 --- a/src/SpawnPrepare.cpp +++ b/src/SpawnPrepare.cpp @@ -119,7 +119,7 @@ void cSpawnPrepare::PreparedChunkCallback(int a_ChunkX, int a_ChunkZ) float PercentDone = static_cast(m_NumPrepared * 100) / m_MaxIdx; float ChunkSpeed = static_cast((m_NumPrepared - m_LastReportChunkCount) * 1000) / std::chrono::duration_cast(Now - m_LastReportTime).count(); LOG("Preparing spawn (%s): %.02f%% (%d/%d; %.02f chunks / sec)", - m_World.GetName().c_str(), PercentDone, m_NumPrepared, m_MaxIdx, ChunkSpeed + m_World.GetName().c_str(), PercentDone, m_NumPrepared.load(std::memory_order_seq_cst), m_MaxIdx, ChunkSpeed ); m_LastReportTime = Now; m_LastReportChunkCount = m_NumPrepared; -- cgit v1.2.3