소스 검색

Fixed an issue with binary deserialization order

Marko Pintera 12 년 전
부모
커밋
df9fbb2af7
2개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 1
      CamelotCore/Source/CmGameObjectManager.cpp
  2. 1 3
      CamelotUtility/Source/CmBinarySerializer.cpp

+ 1 - 1
CamelotCore/Source/CmGameObjectManager.cpp

@@ -72,7 +72,7 @@ namespace CamelotFramework
 				unresolvedHandle.resolve(nullptr);
 		}
 
-		for(auto iter = mEndCallbacks.begin(); iter != mEndCallbacks.end(); ++iter)
+		for(auto iter = mEndCallbacks.rbegin(); iter != mEndCallbacks.rend(); ++iter)
 		{
 			(*iter)();
 		}

+ 1 - 3
CamelotUtility/Source/CmBinarySerializer.cpp

@@ -150,9 +150,7 @@ namespace CamelotFramework
 		} while (decodeInternal(nullptr, dataIter, dataLength, bytesRead));
 
 		// Now go through all of the objects and actually decode them
-		// We go back to front because objects with highest ids are the ones lowest in the object hierarchy,
-		// so we want to decode them before their parents
-		for(auto iter = mObjectMap.rbegin(); iter != mObjectMap.rend(); ++iter)
+		for(auto iter = mObjectMap.begin(); iter != mObjectMap.end(); ++iter)
 		{
 			ObjectToDecode& objToDecode = iter->second;