mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
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
This commit is contained in:
@@ -3190,13 +3190,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatarFromInventory");
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
ForceAttachToAvatarFromInventory(m_host.OwnerID, itemName, attachmentPoint);
|
||||
}
|
||||
|
||||
public void osForceAttachToOtherAvatarFromInventory(string rawAvatarId, string itemName, int attachmentPoint)
|
||||
{
|
||||
CheckThreatLevel(ThreatLevel.Severe, "osForceAttachToOtherAvatarFromInventory");
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
UUID avatarId;
|
||||
|
||||
if (!UUID.TryParse(rawAvatarId, out avatarId))
|
||||
return;
|
||||
|
||||
ForceAttachToAvatarFromInventory(avatarId, itemName, attachmentPoint);
|
||||
}
|
||||
|
||||
public void ForceAttachToAvatarFromInventory(UUID avatarId, string itemName, int attachmentPoint)
|
||||
{
|
||||
IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
|
||||
|
||||
if (attachmentsModule == null)
|
||||
return;
|
||||
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
InitLSL();
|
||||
|
||||
TaskInventoryItem item = m_host.Inventory.GetInventoryItem(itemName);
|
||||
@@ -3219,7 +3238,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
return;
|
||||
}
|
||||
|
||||
ScenePresence sp = World.GetScenePresence(m_host.OwnerID);
|
||||
ScenePresence sp = World.GetScenePresence(avatarId);
|
||||
|
||||
if (sp == null)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user