Преглед на файлове

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;