mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 06:06:06 +08:00
Fix scripted give and interactive give to offline avatars. Both folder and
single items are now supported. Magic Boxes, yeah!
This commit is contained in:
@@ -4005,9 +4005,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory));
|
||||
}
|
||||
|
||||
// check if destination is an avatar
|
||||
if (World.GetScenePresence(destId) != null)
|
||||
// check if destination is an object
|
||||
if (World.GetSceneObjectPart(destId) != null)
|
||||
{
|
||||
// destination is an object
|
||||
World.MoveTaskInventoryItem(destId, m_host, objId);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScenePresence presence = World.GetScenePresence(destId);
|
||||
|
||||
if (presence == null)
|
||||
{
|
||||
UserAccount account =
|
||||
World.UserAccountService.GetUserAccount(
|
||||
World.RegionInfo.ScopeID,
|
||||
destId);
|
||||
|
||||
if (account == null)
|
||||
{
|
||||
llSay(0, "Can't find destination "+destId.ToString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// destination is an avatar
|
||||
InventoryItemBase agentItem =
|
||||
World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId);
|
||||
@@ -4037,12 +4058,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
//This delay should only occur when giving inventory to avatars.
|
||||
ScriptSleep(3000);
|
||||
}
|
||||
else
|
||||
{
|
||||
// destination is an object
|
||||
World.MoveTaskInventoryItem(destId, m_host, objId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
[DebuggerNonUserCode]
|
||||
|
||||
Reference in New Issue
Block a user