realXtend/naali — Issue #267: Preserve parent-child relationships when loading content with generating new IDs
Author: jonnenauha
Created: 2011-11-03 11:47:58+00:00
State: open

1. Save a .txml scene that has EC_Placeable that has parent ref as another entity in the scene.
2. Restart server and load the scene with `Scene::LoadSceneXML()` with parameter useEntityIDsFromFile as false (https://github.com/realXtend/naali/blob/tundra2/src/Core/Scene/Scene.h#L302)
3. The parsings and reassigning new IDs for the entities wont go to the EC_Placeable parent refs and update them to the newly created IDs.

Note: that this bug does not always manifest itself. If the entity IDs start from 1 and continue normally from there, you probably end up generating the exactly the same IDs on loading (if the scene is empty before you did the load) and there for the parent refs will work out of the box. But if you preload something to the scene and then load the new scene you will see the bug. The parents are now different ents or if the ref id is not valid it will put that EC_Placeable to 0,0,0.

Note 2: Our --file start param handling code in `TundraLogicModule::LoadStartupScene()` uses useEntityIDsFromFile = false. https://github.com/realXtend/naali/blob/tundra2/src/Core/TundraProtocolModule/TundraLogicModule.cpp#L345