diff options
author | Melanie Thielker | 2010-05-04 00:44:05 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-05-04 00:44:05 +0200 |
commit | c86259c6710c8ce5c97a7a64bbb96dac35440aec (patch) | |
tree | 339180630c20ebc1099b0c22bc1fcdc0b780e87d /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | Refix the fix (diff) | |
download | opensim-SC_OLD-c86259c6710c8ce5c97a7a64bbb96dac35440aec.zip opensim-SC_OLD-c86259c6710c8ce5c97a7a64bbb96dac35440aec.tar.gz opensim-SC_OLD-c86259c6710c8ce5c97a7a64bbb96dac35440aec.tar.bz2 opensim-SC_OLD-c86259c6710c8ce5c97a7a64bbb96dac35440aec.tar.xz |
Fix scripted give and interactive give to offline avatars. Both folder and
single items are now supported. Magic Boxes, yeah!
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 228e9b8..d216eff 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4005,9 +4005,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4005 | throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); | 4005 | throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); |
4006 | } | 4006 | } |
4007 | 4007 | ||
4008 | // check if destination is an avatar | 4008 | // check if destination is an object |
4009 | if (World.GetScenePresence(destId) != null) | 4009 | if (World.GetSceneObjectPart(destId) != null) |
4010 | { | 4010 | { |
4011 | // destination is an object | ||
4012 | World.MoveTaskInventoryItem(destId, m_host, objId); | ||
4013 | } | ||
4014 | else | ||
4015 | { | ||
4016 | ScenePresence presence = World.GetScenePresence(destId); | ||
4017 | |||
4018 | if (presence == null) | ||
4019 | { | ||
4020 | UserAccount account = | ||
4021 | World.UserAccountService.GetUserAccount( | ||
4022 | World.RegionInfo.ScopeID, | ||
4023 | destId); | ||
4024 | |||
4025 | if (account == null) | ||
4026 | { | ||
4027 | llSay(0, "Can't find destination "+destId.ToString()); | ||
4028 | return; | ||
4029 | } | ||
4030 | } | ||
4031 | |||
4011 | // destination is an avatar | 4032 | // destination is an avatar |
4012 | InventoryItemBase agentItem = | 4033 | InventoryItemBase agentItem = |
4013 | World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId); | 4034 | World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId); |
@@ -4037,12 +4058,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4037 | //This delay should only occur when giving inventory to avatars. | 4058 | //This delay should only occur when giving inventory to avatars. |
4038 | ScriptSleep(3000); | 4059 | ScriptSleep(3000); |
4039 | } | 4060 | } |
4040 | else | ||
4041 | { | ||
4042 | // destination is an object | ||
4043 | World.MoveTaskInventoryItem(destId, m_host, objId); | ||
4044 | } | ||
4045 | |||
4046 | } | 4061 | } |
4047 | 4062 | ||
4048 | [DebuggerNonUserCode] | 4063 | [DebuggerNonUserCode] |