From 33c756b38e94cef68b3f842c1c2f8bad9d4447a2 Mon Sep 17 00:00:00 2001 From: UIS Date: Thu, 10 Dec 2020 15:23:59 +0300 Subject: Fix multithreading Reorder locks in Event.cpp --- src/AssetManager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/AssetManager.cpp') diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index e3e0e05..63dc596 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -658,9 +658,7 @@ BlockFaces &AssetManager::GetBlockModelByBlockId(BlockId block) { blockFaces.faceDirectionVector[i] = Vector(roundf(vec.x), roundf(vec.y), roundf(vec.z)); } - blockIdToBlockFaces.insert(std::make_pair(block, blockFaces)); - - return blockIdToBlockFaces.find(block)->second; + return blockIdToBlockFaces.insert(std::make_pair(block, blockFaces)).first->second; } std::string AssetManager::GetAssetNameByBlockId(BlockId block) { -- cgit v1.2.3