diff options
author | Melanie | 2012-03-11 01:55:36 +0100 |
---|---|---|
committer | Melanie | 2012-03-11 01:55:36 +0100 |
commit | 4f7ec1d691d769b9486c841c008e10aef164998f (patch) | |
tree | 443bd31819ac133d9878c0d906d250cad52e3831 /OpenSim/Region/OptionalModules/World | |
parent | Merge branch 'ubitwork' (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-4f7ec1d691d769b9486c841c008e10aef164998f.zip opensim-SC_OLD-4f7ec1d691d769b9486c841c008e10aef164998f.tar.gz opensim-SC_OLD-4f7ec1d691d769b9486c841c008e10aef164998f.tar.bz2 opensim-SC_OLD-4f7ec1d691d769b9486c841c008e10aef164998f.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Diffstat (limited to 'OpenSim/Region/OptionalModules/World')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index cdb6efe..5b9b071 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -42,9 +42,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
42 | { | 42 | { |
43 | public class NPCAvatar : IClientAPI, INPC | 43 | public class NPCAvatar : IClientAPI, INPC |
44 | { | 44 | { |
45 | private static readonly Dictionary<string, UUID> m_defaultAnimations = new Dictionary<string, UUID>(); | ||
46 | |||
47 | public bool SenseAsAgent { get; set; } | 45 | public bool SenseAsAgent { get; set; } |
46 | |||
48 | private readonly string m_firstname; | 47 | private readonly string m_firstname; |
49 | private readonly string m_lastname; | 48 | private readonly string m_lastname; |
50 | private readonly Vector3 m_startPos; | 49 | private readonly Vector3 m_startPos; |
@@ -61,16 +60,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
61 | m_scene = scene; | 60 | m_scene = scene; |
62 | m_ownerID = ownerID; | 61 | m_ownerID = ownerID; |
63 | SenseAsAgent = senseAsAgent; | 62 | SenseAsAgent = senseAsAgent; |
64 | |||
65 | } | 63 | } |
66 | 64 | ||
67 | static NPCAvatar() | ||
68 | { | ||
69 | InitDefaultAnimations(); | ||
70 | } | ||
71 | |||
72 | |||
73 | |||
74 | public IScene Scene | 65 | public IScene Scene |
75 | { | 66 | { |
76 | get { return m_scene; } | 67 | get { return m_scene; } |
@@ -142,32 +133,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
142 | 133 | ||
143 | } | 134 | } |
144 | 135 | ||
145 | private static void InitDefaultAnimations() | ||
146 | { | ||
147 | using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml")) | ||
148 | { | ||
149 | XmlDocument doc = new XmlDocument(); | ||
150 | doc.Load(reader); | ||
151 | if (doc.DocumentElement != null) | ||
152 | foreach (XmlNode nod in doc.DocumentElement.ChildNodes) | ||
153 | { | ||
154 | if (nod.Attributes["name"] != null) | ||
155 | { | ||
156 | string name = nod.Attributes["name"].Value.ToLower(); | ||
157 | string id = nod.InnerText; | ||
158 | m_defaultAnimations.Add(name, (UUID)id); | ||
159 | } | ||
160 | } | ||
161 | } | ||
162 | } | ||
163 | |||
164 | public UUID GetDefaultAnimation(string name) | 136 | public UUID GetDefaultAnimation(string name) |
165 | { | 137 | { |
166 | if (m_defaultAnimations.ContainsKey(name)) | 138 | return SLUtil.GetDefaultAvatarAnimation(name); |
167 | { | ||
168 | return m_defaultAnimations[name]; | ||
169 | } | ||
170 | return UUID.Zero; | ||
171 | } | 139 | } |
172 | 140 | ||
173 | public Vector3 Position | 141 | public Vector3 Position |