aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-09 23:08:41 +0100
committerJustin Clark-Casey (justincc)2012-07-09 23:08:41 +0100
commitc8af20f966e005fb512869299d80be6b83cb70bf (patch)
treecdab2bc5b186b55c0ce8fcf51919eaca5f3bb5a1 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentDon't allow a prim to be sat upon if its part of an attachment (diff)
downloadopensim-SC-c8af20f966e005fb512869299d80be6b83cb70bf.zip
opensim-SC-c8af20f966e005fb512869299d80be6b83cb70bf.tar.gz
opensim-SC-c8af20f966e005fb512869299d80be6b83cb70bf.tar.bz2
opensim-SC-c8af20f966e005fb512869299d80be6b83cb70bf.tar.xz
This script allows an object to be attached directly from prim inventory to another avatar in the scene.
Very useful in serious game/environment scenarios where its only allowed for trusted creators. Threat level Severe
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs25
1 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 61394af..e90f577 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -3190,13 +3190,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3190 { 3190 {
3191 CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatarFromInventory"); 3191 CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatarFromInventory");
3192 3192
3193 m_host.AddScriptLPS(1);
3194
3195 ForceAttachToAvatarFromInventory(m_host.OwnerID, itemName, attachmentPoint);
3196 }
3197
3198 public void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint)
3199 {
3200 CheckThreatLevel(ThreatLevel.Severe, "osForceAttachToOtherAvatarFromInventory");
3201
3202 m_host.AddScriptLPS(1);
3203
3204 UUID avatarId;
3205
3206 if (!UUID.TryParse(rawAvatarId, out avatarId))
3207 return;
3208
3209 ForceAttachToAvatarFromInventory(avatarId, itemName, attachmentPoint);
3210 }
3211
3212 public void ForceAttachToAvatarFromInventory(UUID avatarId, string itemName, int attachmentPoint)
3213 {
3193 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; 3214 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
3194 3215
3195 if (attachmentsModule == null) 3216 if (attachmentsModule == null)
3196 return; 3217 return;
3197 3218
3198 m_host.AddScriptLPS(1);
3199
3200 InitLSL(); 3219 InitLSL();
3201 3220
3202 TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName); 3221 TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName);
@@ -3219,7 +3238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3219 return; 3238 return;
3220 } 3239 }
3221 3240
3222 ScenePresence sp = World.GetScenePresence(m_host.OwnerID); 3241 ScenePresence sp = World.GetScenePresence(avatarId);
3223 3242
3224 if (sp == null) 3243 if (sp == null)
3225 return; 3244 return;