aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorMelanie2011-05-23 02:52:28 +0100
committerMelanie2011-05-23 02:52:28 +0100
commit24c00acedc1575bf11fb5801bebdc5d45a93c277 (patch)
treeb2f05c39932b16a91dd58c00fdf1d61e91e4c6b5 /OpenSim/Region/ScriptEngine/Shared
parentAdd stubs for unimplemented lsl functions (diff)
downloadopensim-SC_OLD-24c00acedc1575bf11fb5801bebdc5d45a93c277.zip
opensim-SC_OLD-24c00acedc1575bf11fb5801bebdc5d45a93c277.tar.gz
opensim-SC_OLD-24c00acedc1575bf11fb5801bebdc5d45a93c277.tar.bz2
opensim-SC_OLD-24c00acedc1575bf11fb5801bebdc5d45a93c277.tar.xz
Fix Mantis #4429: Allow llGiveInventory to work across sim borders.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs32
1 files changed, 23 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index e3d0dac..ce7d97c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3864,9 +3864,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3864 throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); 3864 throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory));
3865 } 3865 }
3866 3866
3867 // check if destination is an avatar 3867 // check if destination is an object
3868 if (World.GetScenePresence(destId) != null) 3868 if (World.GetSceneObjectPart(destId) != null)
3869 { 3869 {
3870 // destination is an object
3871 World.MoveTaskInventoryItem(destId, m_host, objId);
3872 }
3873 else
3874 {
3875 ScenePresence presence = World.GetScenePresence(destId);
3876
3877 if (presence == null)
3878 {
3879 UserAccount account =
3880 World.UserAccountService.GetUserAccount(
3881 World.RegionInfo.ScopeID,
3882 destId);
3883
3884 if (account == null)
3885 {
3886 llSay(0, "Can't find destination "+destId.ToString());
3887 return;
3888 }
3889 }
3870 // destination is an avatar 3890 // destination is an avatar
3871 InventoryItemBase agentItem = World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId); 3891 InventoryItemBase agentItem = World.MoveTaskInventoryItem(destId, UUID.Zero, m_host, objId);
3872 3892
@@ -3887,16 +3907,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3887 m_host.AbsolutePosition.ToString(), 3907 m_host.AbsolutePosition.ToString(),
3888 agentItem.ID, true, m_host.AbsolutePosition, 3908 agentItem.ID, true, m_host.AbsolutePosition,
3889 bucket); 3909 bucket);
3890
3891 if (m_TransferModule != null) 3910 if (m_TransferModule != null)
3892 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 3911 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
3912 ScriptSleep(3000);
3893 } 3913 }
3894 else
3895 {
3896 // destination is an object
3897 World.MoveTaskInventoryItem(destId, m_host, objId);
3898 }
3899 ScriptSleep(3000);
3900 } 3914 }
3901 3915
3902 public void llRemoveInventory(string name) 3916 public void llRemoveInventory(string name)