diff options
author | Melanie | 2011-10-11 23:15:41 +0100 |
---|---|---|
committer | Melanie | 2011-10-11 23:15:41 +0100 |
commit | efaa113fb965dde851d5892d7c7ce2b7a2cf815c (patch) | |
tree | e20110f40a313ed1c3b589fd9d92dd8ec25f074d /OpenSim | |
parent | Merge commit 'a1875ec7600758087f6c06ccaf625507362e215c' into bigmerge (diff) | |
parent | llGetLinkKey, llGetLinkName Fix for sitting Avatar (diff) | |
download | opensim-SC-efaa113fb965dde851d5892d7c7ce2b7a2cf815c.zip opensim-SC-efaa113fb965dde851d5892d7c7ce2b7a2cf815c.tar.gz opensim-SC-efaa113fb965dde851d5892d7c7ce2b7a2cf815c.tar.bz2 opensim-SC-efaa113fb965dde851d5892d7c7ce2b7a2cf815c.tar.xz |
Merge commit 'c7db3df3442657cda398ff2f90d387bce98c718a' into bigmerge
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 1b82ad1..9feed38 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4104,6 +4104,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4104 | public LSL_String llGetLinkKey(int linknum) | 4104 | public LSL_String llGetLinkKey(int linknum) |
4105 | { | 4105 | { |
4106 | m_host.AddScriptLPS(1); | 4106 | m_host.AddScriptLPS(1); |
4107 | List<UUID> keytable = new List<UUID>(); | ||
4108 | // parse for sitting avatare-uuids | ||
4109 | World.ForEachScenePresence(delegate(ScenePresence presence) | ||
4110 | { | ||
4111 | if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) | ||
4112 | keytable.Add(presence.UUID); | ||
4113 | }); | ||
4114 | |||
4115 | int totalprims = m_host.ParentGroup.PrimCount + keytable.Count; | ||
4116 | if (linknum > m_host.ParentGroup.PrimCount && linknum <= totalprims) | ||
4117 | { | ||
4118 | return keytable[totalprims - linknum].ToString(); | ||
4119 | } | ||
4120 | |||
4121 | if (linknum == 1 && m_host.ParentGroup.PrimCount == 1 && keytable.Count == 1) | ||
4122 | { | ||
4123 | return m_host.UUID.ToString(); | ||
4124 | } | ||
4125 | |||
4107 | SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); | 4126 | SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); |
4108 | if (part != null) | 4127 | if (part != null) |
4109 | { | 4128 | { |
@@ -4160,6 +4179,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4160 | public LSL_String llGetLinkName(int linknum) | 4179 | public LSL_String llGetLinkName(int linknum) |
4161 | { | 4180 | { |
4162 | m_host.AddScriptLPS(1); | 4181 | m_host.AddScriptLPS(1); |
4182 | // parse for sitting avatare-names | ||
4183 | List<String> nametable = new List<String>(); | ||
4184 | World.ForEachScenePresence(delegate(ScenePresence presence) | ||
4185 | { | ||
4186 | if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) | ||
4187 | nametable.Add(presence.ControllingClient.Name); | ||
4188 | }); | ||
4189 | |||
4190 | int totalprims = m_host.ParentGroup.PrimCount + nametable.Count; | ||
4191 | if (totalprims > m_host.ParentGroup.PrimCount) | ||
4192 | { | ||
4193 | // sitting Avatar-Name with negativ linknum / SinglePrim | ||
4194 | if (linknum < 0 && m_host.ParentGroup.PrimCount == 1 && nametable.Count == 1) | ||
4195 | return nametable[0]; | ||
4196 | // Prim-Name / SinglePrim Sitting Avatar | ||
4197 | if (linknum == 1 && m_host.ParentGroup.PrimCount == 1 && nametable.Count == 1) | ||
4198 | return m_host.Name; | ||
4199 | // LinkNumber > of Real PrimSet = AvatarName | ||
4200 | if (linknum > m_host.ParentGroup.PrimCount && linknum <= totalprims) | ||
4201 | return nametable[totalprims - linknum]; | ||
4202 | } | ||
4163 | 4203 | ||
4164 | // simplest case, this prims link number | 4204 | // simplest case, this prims link number |
4165 | if (m_host.LinkNum == linknum) | 4205 | if (m_host.LinkNum == linknum) |
@@ -4173,6 +4213,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4173 | else | 4213 | else |
4174 | return UUID.Zero.ToString(); | 4214 | return UUID.Zero.ToString(); |
4175 | } | 4215 | } |
4216 | |||
4176 | // Link set | 4217 | // Link set |
4177 | SceneObjectPart part = null; | 4218 | SceneObjectPart part = null; |
4178 | if (m_host.LinkNum == 1) // this is the Root prim | 4219 | if (m_host.LinkNum == 1) // this is the Root prim |