diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 72 |
1 files changed, 60 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index fcbcf59..0f85925 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1955,11 +1955,49 @@ namespace OpenSim.Region.Framework.Scenes | |||
1955 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, | 1955 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, |
1956 | bool RezSelected, bool RemoveItem, UUID fromTaskID) | 1956 | bool RezSelected, bool RemoveItem, UUID fromTaskID) |
1957 | { | 1957 | { |
1958 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); | 1958 | // m_log.DebugFormat( |
1959 | if (invAccess != null) | 1959 | // "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}", |
1960 | invAccess.RezObject( | 1960 | // remoteClient.Name, itemID, fromTaskID); |
1961 | remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, | 1961 | |
1962 | RezSelected, RemoveItem, fromTaskID, false); | 1962 | if (fromTaskID == UUID.Zero) |
1963 | { | ||
1964 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); | ||
1965 | if (invAccess != null) | ||
1966 | invAccess.RezObject( | ||
1967 | remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, | ||
1968 | RezSelected, RemoveItem, fromTaskID, false); | ||
1969 | } | ||
1970 | else | ||
1971 | { | ||
1972 | SceneObjectPart part = GetSceneObjectPart(fromTaskID); | ||
1973 | if (part == null) | ||
1974 | { | ||
1975 | m_log.ErrorFormat( | ||
1976 | "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object", | ||
1977 | remoteClient.Name, itemID, fromTaskID); | ||
1978 | |||
1979 | return; | ||
1980 | } | ||
1981 | |||
1982 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID); | ||
1983 | if (item == null) | ||
1984 | { | ||
1985 | m_log.ErrorFormat( | ||
1986 | "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item", | ||
1987 | remoteClient.Name, itemID, fromTaskID); | ||
1988 | |||
1989 | return; | ||
1990 | } | ||
1991 | |||
1992 | byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); | ||
1993 | Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f); | ||
1994 | Vector3 pos | ||
1995 | = GetNewRezLocation( | ||
1996 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, | ||
1997 | BypassRayCast, bRayEndIsIntersection, true, scale, false); | ||
1998 | |||
1999 | RezObject(part, item, pos, null, Vector3.Zero, 0); | ||
2000 | } | ||
1963 | } | 2001 | } |
1964 | 2002 | ||
1965 | /// <summary> | 2003 | /// <summary> |
@@ -1967,14 +2005,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1967 | /// </summary> | 2005 | /// </summary> |
1968 | /// <param name="sourcePart"></param> | 2006 | /// <param name="sourcePart"></param> |
1969 | /// <param name="item"></param> | 2007 | /// <param name="item"></param> |
1970 | /// <param name="pos"></param> | 2008 | /// <param name="pos">The position of the rezzed object.</param> |
1971 | /// <param name="rot"></param> | 2009 | /// <param name="rot">The rotation of the rezzed object. If null, then the rotation stored with the object |
1972 | /// <param name="vel"></param> | 2010 | /// will be used if it exists.</param> |
2011 | /// <param name="vel">The velocity of the rezzed object.</param> | ||
1973 | /// <param name="param"></param> | 2012 | /// <param name="param"></param> |
1974 | /// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful</returns> | 2013 | /// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful</returns> |
1975 | public virtual SceneObjectGroup RezObject( | 2014 | public virtual SceneObjectGroup RezObject( |
1976 | SceneObjectPart sourcePart, TaskInventoryItem item, | 2015 | SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param) |
1977 | Vector3 pos, Quaternion rot, Vector3 vel, int param) | ||
1978 | { | 2016 | { |
1979 | if (null == item) | 2017 | if (null == item) |
1980 | return null; | 2018 | return null; |
@@ -1992,8 +2030,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1992 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 2030 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
1993 | sourcePart.Inventory.RemoveInventoryItem(item.ItemID); | 2031 | sourcePart.Inventory.RemoveInventoryItem(item.ItemID); |
1994 | } | 2032 | } |
1995 | 2033 | ||
1996 | AddNewSceneObject(group, true, pos, rot, vel); | 2034 | AddNewSceneObject(group, true); |
2035 | |||
2036 | group.AbsolutePosition = pos; | ||
2037 | group.Velocity = vel; | ||
2038 | |||
2039 | if (rot != null) | ||
2040 | group.UpdateGroupRotationR((Quaternion)rot); | ||
1997 | 2041 | ||
1998 | // We can only call this after adding the scene object, since the scene object references the scene | 2042 | // We can only call this after adding the scene object, since the scene object references the scene |
1999 | // to find out if scripts should be activated at all. | 2043 | // to find out if scripts should be activated at all. |
@@ -2069,7 +2113,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2069 | SceneObjectPart[] partList = sog.Parts; | 2113 | SceneObjectPart[] partList = sog.Parts; |
2070 | 2114 | ||
2071 | foreach (SceneObjectPart child in partList) | 2115 | foreach (SceneObjectPart child in partList) |
2116 | { | ||
2072 | child.Inventory.ChangeInventoryOwner(ownerID); | 2117 | child.Inventory.ChangeInventoryOwner(ownerID); |
2118 | child.TriggerScriptChangedEvent(Changed.OWNER); | ||
2119 | } | ||
2073 | } | 2120 | } |
2074 | else | 2121 | else |
2075 | { | 2122 | { |
@@ -2085,6 +2132,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2085 | { | 2132 | { |
2086 | child.LastOwnerID = child.OwnerID; | 2133 | child.LastOwnerID = child.OwnerID; |
2087 | child.Inventory.ChangeInventoryOwner(groupID); | 2134 | child.Inventory.ChangeInventoryOwner(groupID); |
2135 | child.TriggerScriptChangedEvent(Changed.OWNER); | ||
2088 | } | 2136 | } |
2089 | 2137 | ||
2090 | sog.SetOwnerId(groupID); | 2138 | sog.SetOwnerId(groupID); |