diff options
small bit of refactoring
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 21edbac..1839051 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -270,26 +270,31 @@ namespace OpenSim.Region.Environment.Scenes | |||
270 | StringReader sr = new StringReader(xmlData); | 270 | StringReader sr = new StringReader(xmlData); |
271 | XmlTextReader reader = new XmlTextReader(sr); | 271 | XmlTextReader reader = new XmlTextReader(sr); |
272 | reader.Read(); | 272 | reader.Read(); |
273 | |||
273 | reader.ReadStartElement("SceneObjectGroup"); | 274 | reader.ReadStartElement("SceneObjectGroup"); |
274 | // reader.ReadStartElement("RootPart"); | 275 | // reader.ReadStartElement("RootPart"); |
275 | m_rootPart = SceneObjectPart.FromXml(reader); | 276 | m_rootPart = SceneObjectPart.FromXml(reader); |
276 | //reader.ReadEndElement(); | ||
277 | 277 | ||
278 | while (reader.Read()) | 278 | reader.Read(); |
279 | bool more = true; | ||
280 | |||
281 | while (more) | ||
279 | { | 282 | { |
280 | switch (reader.NodeType) | 283 | switch (reader.NodeType) |
281 | { | 284 | { |
282 | case XmlNodeType.Element: | 285 | case XmlNodeType.Element: |
283 | if (reader.Name == "SceneObjectPart") | 286 | if (reader.Name == "SceneObjectPart") |
284 | { | 287 | { |
285 | // reader.Read(); | ||
286 | SceneObjectPart Part = SceneObjectPart.FromXml(reader); | 288 | SceneObjectPart Part = SceneObjectPart.FromXml(reader); |
287 | AddPart(Part); | 289 | AddPart(Part); |
290 | |||
288 | } | 291 | } |
289 | break; | 292 | break; |
290 | case XmlNodeType.EndElement: | 293 | case XmlNodeType.EndElement: |
294 | reader.Read(); | ||
291 | break; | 295 | break; |
292 | } | 296 | } |
297 | more = !reader.EOF; | ||
293 | } | 298 | } |
294 | reader.Close(); | 299 | reader.Close(); |
295 | sr.Close(); | 300 | sr.Close(); |