aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs34
1 files changed, 21 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index ec37836..19e557f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -911,28 +911,36 @@ namespace OpenSim.Region.Framework.Scenes
911 911
912 public void LoadScriptState(XmlReader reader) 912 public void LoadScriptState(XmlReader reader)
913 { 913 {
914// m_log.DebugFormat("[SCENE OBJECT GROUP]: Looking for script state for {0} in {1}", Name); 914// m_log.DebugFormat("[SCENE OBJECT GROUP]: Looking for script state for {0}", Name);
915 915
916 while (reader.ReadToFollowing("SavedScriptState")) 916 while (true)
917 { 917 {
918// m_log.DebugFormat("[SCENE OBJECT GROUP]: Loading script state for {0}", Name); 918 if (reader.Name == "SavedScriptState" && reader.NodeType == XmlNodeType.Element)
919 {
920// m_log.DebugFormat("[SCENE OBJECT GROUP]: Loading script state for {0}", Name);
919 921
920 if (m_savedScriptState == null) 922 if (m_savedScriptState == null)
921 m_savedScriptState = new Dictionary<UUID, string>(); 923 m_savedScriptState = new Dictionary<UUID, string>();
922 924
923 string uuid = reader.GetAttribute("UUID"); 925 string uuid = reader.GetAttribute("UUID");
924 926
925 if (uuid != null) 927 if (uuid != null)
926 { 928 {
927// m_log.DebugFormat("[SCENE OBJECT GROUP]: Found state for item ID {0} in object {1}", uuid, Name); 929// m_log.DebugFormat("[SCENE OBJECT GROUP]: Found state for item ID {0} in object {1}", uuid, Name);
928 930
929 UUID itemid = new UUID(uuid); 931 UUID itemid = new UUID(uuid);
930 if (itemid != UUID.Zero) 932 if (itemid != UUID.Zero)
931 m_savedScriptState[itemid] = reader.ReadInnerXml(); 933 m_savedScriptState[itemid] = reader.ReadInnerXml();
934 }
935 else
936 {
937 m_log.WarnFormat("[SCENE OBJECT GROUP]: SavedScriptState element had no UUID in object {0}", Name);
938 }
932 } 939 }
933 else 940 else
934 { 941 {
935 m_log.WarnFormat("[SCENE OBJECT GROUP]: SavedScriptState element had no UUID in object {0}", Name); 942 if (!reader.Read())
943 break;
936 } 944 }
937 } 945 }
938 } 946 }