aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs14
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs27
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs2
3 files changed, 34 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 4458a4d..4b30a80 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -233,6 +233,7 @@ namespace OpenSim.Region.Environment.Scenes
233 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID) 233 public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID)
234 { 234 {
235 CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId); 235 CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId);
236 LLUUID copyID = LLUUID.Random();
236 if (userInfo != null) 237 if (userInfo != null)
237 { 238 {
238 if (userInfo.RootFolder != null) 239 if (userInfo.RootFolder != null)
@@ -251,7 +252,7 @@ namespace OpenSim.Region.Environment.Scenes
251 { 252 {
252 string script = Util.FieldToString(rezAsset.Data); 253 string script = Util.FieldToString(rezAsset.Data);
253 //Console.WriteLine("rez script "+script); 254 //Console.WriteLine("rez script "+script);
254 this.EventManager.TriggerRezScript(localID, itemID, script); 255 this.EventManager.TriggerRezScript(localID, copyID, script);
255 rezzed = true; 256 rezzed = true;
256 } 257 }
257 else 258 else
@@ -262,7 +263,7 @@ namespace OpenSim.Region.Environment.Scenes
262 { 263 {
263 string script = Util.FieldToString(rezAsset.Data); 264 string script = Util.FieldToString(rezAsset.Data);
264 // Console.WriteLine("rez script " + script); 265 // Console.WriteLine("rez script " + script);
265 this.EventManager.TriggerRezScript(localID, itemID, script); 266 this.EventManager.TriggerRezScript(localID, copyID, script);
266 rezzed = true; 267 rezzed = true;
267 } 268 }
268 } 269 }
@@ -277,13 +278,10 @@ namespace OpenSim.Region.Environment.Scenes
277 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID); 278 hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
278 if (hasPrim != false) 279 if (hasPrim != false)
279 { 280 {
280 bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item); 281
282 bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID);
281 ((SceneObjectGroup)ent).GetProperites(remoteClient); 283 ((SceneObjectGroup)ent).GetProperites(remoteClient);
282 if (added) 284
283 {
284 userInfo.DeleteItem(remoteClient.AgentId, item);
285 remoteClient.SendRemoveInventoryItem(itemID);
286 }
287 } 285 }
288 } 286 }
289 } 287 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 6945acb..ba6f6ea 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -655,6 +655,33 @@ namespace OpenSim.Region.Environment.Scenes
655 655
656 } 656 }
657 657
658 public bool AddInventoryItem(IClientAPI remoteClient, uint localID, InventoryItemBase item, LLUUID copyItemID)
659 {
660 if (copyItemID != LLUUID.Zero)
661 {
662 SceneObjectPart part = this.GetChildPart(localID);
663 if (part != null)
664 {
665 SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem();
666 taskItem.item_id = copyItemID;
667 taskItem.asset_id = item.assetID;
668 taskItem.name = item.inventoryName;
669 taskItem.desc = item.inventoryDescription;
670 taskItem.owner_id = new LLUUID(item.avatarID.ToString());
671 taskItem.creator_id = new LLUUID(item.creatorsID.ToString());
672 taskItem.type = SceneObjectPart.TaskInventoryItem.Types[item.assetType];
673 taskItem.inv_type = SceneObjectPart.TaskInventoryItem.Types[item.invType];
674 part.AddInventoryItem(taskItem);
675 return true;
676 }
677 }
678 else
679 {
680 return AddInventoryItem(remoteClient, localID, item);
681 }
682 return false;
683 }
684
658 public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID) 685 public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID)
659 { 686 {
660 SceneObjectPart part = this.GetChildPart(localID); 687 SceneObjectPart part = this.GetChildPart(localID);
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index d7479bd..d681f99 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -83,7 +83,7 @@ namespace OpenSim.Region.Environment.Scenes
83 set { m_name = value; } 83 set { m_name = value; }
84 } 84 }
85 85
86 protected LLObject.ObjectFlags m_flags = (LLObject.ObjectFlags)32 + 65536 + 131072 + 256 + 4 + 8 + 268435456 + 128; 86 protected LLObject.ObjectFlags m_flags = (LLObject.ObjectFlags)32 + 65536 + 131072 + 256 + 4 + 8 + 268435456 + 128 + (uint)LLObject.ObjectFlags.Physics;
87 public uint ObjectFlags 87 public uint ObjectFlags
88 { 88 {
89 get { return (uint)m_flags; } 89 get { return (uint)m_flags; }