From 7020624be4ef0b3814bc9d0402951bda3db1a360 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Wed, 6 Feb 2013 00:02:06 -0500 Subject: [PATCH] Fix clone loading race condition. This happens on DirtSand shards when two avatars are loading the same age at once. LoadCloneMsgs are dispatched to the clients before they have loaded the original keys. The server has no way of knowing that however, so this is the correct place to fix the problem. --- .../Plasma/PubUtilLib/plNetClient/plNetClientMgrLoad.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrLoad.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrLoad.cpp index 3be4d441..564ae83e 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrLoad.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrLoad.cpp @@ -105,6 +105,12 @@ plKey plNetClientMgr::ILoadClone(plLoadCloneMsg *pCloneMsg) if(pCloneMsg->GetIsLoading()) { + if (!cloneKey) + { + DebugMsg("ILoadClone: got a null clone key... either a loading race or someone is being naughty."); + return nullptr; + } + if (cloneKey->ObjectIsLoaded()) { DebugMsg("ILoadClone: object %s is already loaded, ignoring", cloneKey->GetUoid().StringIze().c_str());