diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index c4fafde..0eb8412 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | |||
@@ -122,6 +122,8 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
122 | public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID) | 122 | public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID) |
123 | { | 123 | { |
124 | Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>(); | 124 | Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>(); |
125 | Dictionary<LLUUID, SceneObjectPart> loadedParentlessParts = new Dictionary<LLUUID, SceneObjectPart>(); | ||
126 | |||
125 | List<SceneObjectGroup> retvals = new List<SceneObjectGroup>(); | 127 | List<SceneObjectGroup> retvals = new List<SceneObjectGroup>(); |
126 | 128 | ||
127 | DataTable prims = ds.Tables["prims"]; | 129 | DataTable prims = ds.Tables["prims"]; |
@@ -168,8 +170,25 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
168 | Console.WriteLine("No shape found for prim in storage, so setting default box shape"); | 170 | Console.WriteLine("No shape found for prim in storage, so setting default box shape"); |
169 | prim.Shape = BoxShape.Default; | 171 | prim.Shape = BoxShape.Default; |
170 | } | 172 | } |
171 | createdObjects[new LLUUID(objID)].AddPart(prim); | 173 | if (createdObjects.ContainsKey(new LLUUID(objID))) |
174 | { | ||
175 | createdObjects[new LLUUID(objID)].AddPart(prim); | ||
176 | } | ||
177 | else | ||
178 | { | ||
179 | loadedParentlessParts.Add(new LLUUID(objID), prim); | ||
180 | } | ||
172 | } | 181 | } |
182 | |||
183 | foreach (KeyValuePair<LLUUID, SceneObjectPart> kvp in loadedParentlessParts) | ||
184 | { | ||
185 | if (createdObjects.ContainsKey(kvp.Key)) | ||
186 | { | ||
187 | createdObjects[kvp.Key].AddPart(kvp.Value); | ||
188 | } | ||
189 | } | ||
190 | |||
191 | loadedParentlessParts.Clear(); | ||
173 | } | 192 | } |
174 | 193 | ||
175 | MainLog.Instance.Verbose("DATASTORE", "Sqlite - LoadObjects found " + prims.Rows.Count + " primitives"); | 194 | MainLog.Instance.Verbose("DATASTORE", "Sqlite - LoadObjects found " + prims.Rows.Count + " primitives"); |