Scripts are now copied into a prim (ie new copy placed in the prim) rather than moved into there.
parent
a53125aae0
commit
df73446bee
|
@ -233,6 +233,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
public void RezScript(IClientAPI remoteClient, LLUUID itemID, uint localID)
|
||||
{
|
||||
CachedUserInfo userInfo = commsManager.UserProfiles.GetUserDetails(remoteClient.AgentId);
|
||||
LLUUID copyID = LLUUID.Random();
|
||||
if (userInfo != null)
|
||||
{
|
||||
if (userInfo.RootFolder != null)
|
||||
|
@ -251,7 +252,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
string script = Util.FieldToString(rezAsset.Data);
|
||||
//Console.WriteLine("rez script "+script);
|
||||
this.EventManager.TriggerRezScript(localID, itemID, script);
|
||||
this.EventManager.TriggerRezScript(localID, copyID, script);
|
||||
rezzed = true;
|
||||
}
|
||||
else
|
||||
|
@ -262,7 +263,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
string script = Util.FieldToString(rezAsset.Data);
|
||||
// Console.WriteLine("rez script " + script);
|
||||
this.EventManager.TriggerRezScript(localID, itemID, script);
|
||||
this.EventManager.TriggerRezScript(localID, copyID, script);
|
||||
rezzed = true;
|
||||
}
|
||||
}
|
||||
|
@ -277,13 +278,10 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
hasPrim = ((SceneObjectGroup)ent).HasChildPrim(localID);
|
||||
if (hasPrim != false)
|
||||
{
|
||||
bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item);
|
||||
|
||||
bool added = ((SceneObjectGroup)ent).AddInventoryItem(remoteClient, localID, item, copyID);
|
||||
((SceneObjectGroup)ent).GetProperites(remoteClient);
|
||||
if (added)
|
||||
{
|
||||
userInfo.DeleteItem(remoteClient.AgentId, item);
|
||||
remoteClient.SendRemoveInventoryItem(itemID);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -655,6 +655,33 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
}
|
||||
|
||||
public bool AddInventoryItem(IClientAPI remoteClient, uint localID, InventoryItemBase item, LLUUID copyItemID)
|
||||
{
|
||||
if (copyItemID != LLUUID.Zero)
|
||||
{
|
||||
SceneObjectPart part = this.GetChildPart(localID);
|
||||
if (part != null)
|
||||
{
|
||||
SceneObjectPart.TaskInventoryItem taskItem = new SceneObjectPart.TaskInventoryItem();
|
||||
taskItem.item_id = copyItemID;
|
||||
taskItem.asset_id = item.assetID;
|
||||
taskItem.name = item.inventoryName;
|
||||
taskItem.desc = item.inventoryDescription;
|
||||
taskItem.owner_id = new LLUUID(item.avatarID.ToString());
|
||||
taskItem.creator_id = new LLUUID(item.creatorsID.ToString());
|
||||
taskItem.type = SceneObjectPart.TaskInventoryItem.Types[item.assetType];
|
||||
taskItem.inv_type = SceneObjectPart.TaskInventoryItem.Types[item.invType];
|
||||
part.AddInventoryItem(taskItem);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return AddInventoryItem(remoteClient, localID, item);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int RemoveInventoryItem(IClientAPI remoteClient, uint localID, LLUUID itemID)
|
||||
{
|
||||
SceneObjectPart part = this.GetChildPart(localID);
|
||||
|
|
|
@ -83,7 +83,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
set { m_name = value; }
|
||||
}
|
||||
|
||||
protected LLObject.ObjectFlags m_flags = (LLObject.ObjectFlags)32 + 65536 + 131072 + 256 + 4 + 8 + 268435456 + 128;
|
||||
protected LLObject.ObjectFlags m_flags = (LLObject.ObjectFlags)32 + 65536 + 131072 + 256 + 4 + 8 + 268435456 + 128 + (uint)LLObject.ObjectFlags.Physics;
|
||||
public uint ObjectFlags
|
||||
{
|
||||
get { return (uint)m_flags; }
|
||||
|
|
Loading…
Reference in New Issue