diff --git a/src/server/collision/Management/VMapManager2.cpp b/src/server/collision/Management/VMapManager2.cpp index 9f32c749c5..0632542f82 100644 --- a/src/server/collision/Management/VMapManager2.cpp +++ b/src/server/collision/Management/VMapManager2.cpp @@ -247,6 +247,9 @@ namespace VMAP WorldModel* VMapManager2::acquireModelInstance(const std::string& basepath, const std::string& filename) { + //! Critical section, thread safe access to iLoadedModelFiles + TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock); + ModelFileMap::iterator model = iLoadedModelFiles.find(filename); if (model == iLoadedModelFiles.end()) { @@ -267,6 +270,9 @@ namespace VMAP void VMapManager2::releaseModelInstance(const std::string &filename) { + //! Critical section, thread safe access to iLoadedModelFiles + TRINITY_GUARD(ACE_Thread_Mutex, LoadedModelFilesLock); + ModelFileMap::iterator model = iLoadedModelFiles.find(filename); if (model == iLoadedModelFiles.end()) { diff --git a/src/server/collision/Management/VMapManager2.h b/src/server/collision/Management/VMapManager2.h index ac293e2071..83fec0f0d1 100755 --- a/src/server/collision/Management/VMapManager2.h +++ b/src/server/collision/Management/VMapManager2.h @@ -22,6 +22,7 @@ #include "IVMapManager.h" #include "Dynamic/UnorderedMap.h" #include "Define.h" +#include //=========================================================== @@ -71,6 +72,8 @@ namespace VMAP // Tree to check collision ModelFileMap iLoadedModelFiles; InstanceTreeMap iInstanceMapTrees; + // Mutex for iLoadedModelFiles + ACE_Thread_Mutex LoadedModelFilesLock; bool _loadMap(uint32 mapId, const std::string& basePath, uint32 tileX, uint32 tileY); /* void _unloadMap(uint32 pMapId, uint32 x, uint32 y); */ diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5565aacc0e..bc3a1be7ff 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -18443,7 +18443,7 @@ void Player::SaveToDB(bool create /*=false*/) ss.str(""); for (uint32 i = 0; i < KNOWN_TITLES_SIZE*2; ++i) - ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i); + ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i) << ' '; stmt->setString(index++, ss.str()); stmt->setUInt8(index++, GetByteValue(PLAYER_FIELD_BYTES, 2));