From 4fcb4fdec3d3cf2c63006d17accba66c10bdaa31 Mon Sep 17 00:00:00 2001 From: mingchen Date: Mon, 4 Jun 2007 19:27:31 +0000 Subject: [PATCH] Fixed loading of Animations from XML file *Still crashes the client. HelP! --- .../OpenSim.RegionServer/world/AvatarAnimations.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs b/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs index 8fa9c420b8..2c1280dcca 100644 --- a/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs +++ b/OpenSim/OpenSim.RegionServer/world/AvatarAnimations.cs @@ -20,15 +20,18 @@ namespace OpenSim.world { OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW,"Avatar.cs:LoadAnims() - Loading avatar animations"); XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"); + XmlDocument doc = new XmlDocument(); doc.Load(reader); - - foreach (XmlNode nod in doc.FirstChild.ChildNodes) + foreach (XmlNode nod in doc.DocumentElement.ChildNodes) { - if (nod.Attributes["name"] != null) + + if ( nod.Attributes["name"] != null) { - AnimsLLUUID.Add(nod.Attributes["name"].ToString(), new LLUUID(nod.Value)); + //Console.WriteLine("'" + nod.Attributes["name"].Value + "' - '" + nod.InnerText + "'"); + AnimsLLUUID.Add(nod.Attributes["name"].Value, nod.InnerText); } + } reader.Close();