diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 68 |
1 files changed, 56 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 0748954..f41c6b9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2005,11 +2005,49 @@ namespace OpenSim.Region.Framework.Scenes | |||
2005 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, | 2005 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, |
2006 | bool RezSelected, bool RemoveItem, UUID fromTaskID) | 2006 | bool RezSelected, bool RemoveItem, UUID fromTaskID) |
2007 | { | 2007 | { |
2008 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); | 2008 | // m_log.DebugFormat( |
2009 | if (invAccess != null) | 2009 | // "[PRIM INVENTORY]: RezObject from {0} for item {1} from task id {2}", |
2010 | invAccess.RezObject( | 2010 | // remoteClient.Name, itemID, fromTaskID); |
2011 | remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, | 2011 | |
2012 | RezSelected, RemoveItem, fromTaskID, false); | 2012 | if (fromTaskID == UUID.Zero) |
2013 | { | ||
2014 | IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>(); | ||
2015 | if (invAccess != null) | ||
2016 | invAccess.RezObject( | ||
2017 | remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, | ||
2018 | RezSelected, RemoveItem, fromTaskID, false); | ||
2019 | } | ||
2020 | else | ||
2021 | { | ||
2022 | SceneObjectPart part = GetSceneObjectPart(fromTaskID); | ||
2023 | if (part == null) | ||
2024 | { | ||
2025 | m_log.ErrorFormat( | ||
2026 | "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such scene object", | ||
2027 | remoteClient.Name, itemID, fromTaskID); | ||
2028 | |||
2029 | return; | ||
2030 | } | ||
2031 | |||
2032 | TaskInventoryItem item = part.Inventory.GetInventoryItem(itemID); | ||
2033 | if (item == null) | ||
2034 | { | ||
2035 | m_log.ErrorFormat( | ||
2036 | "[TASK INVENTORY]: {0} tried to rez item id {1} from object id {2} but there is no such item", | ||
2037 | remoteClient.Name, itemID, fromTaskID); | ||
2038 | |||
2039 | return; | ||
2040 | } | ||
2041 | |||
2042 | byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); | ||
2043 | Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f); | ||
2044 | Vector3 pos | ||
2045 | = GetNewRezLocation( | ||
2046 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, | ||
2047 | BypassRayCast, bRayEndIsIntersection, true, scale, false); | ||
2048 | |||
2049 | RezObject(part, item, pos, null, Vector3.Zero, 0); | ||
2050 | } | ||
2013 | } | 2051 | } |
2014 | 2052 | ||
2015 | /// <summary> | 2053 | /// <summary> |
@@ -2017,14 +2055,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2017 | /// </summary> | 2055 | /// </summary> |
2018 | /// <param name="sourcePart"></param> | 2056 | /// <param name="sourcePart"></param> |
2019 | /// <param name="item"></param> | 2057 | /// <param name="item"></param> |
2020 | /// <param name="pos"></param> | 2058 | /// <param name="pos">The position of the rezzed object.</param> |
2021 | /// <param name="rot"></param> | 2059 | /// <param name="rot">The rotation of the rezzed object. If null, then the rotation stored with the object |
2022 | /// <param name="vel"></param> | 2060 | /// will be used if it exists.</param> |
2061 | /// <param name="vel">The velocity of the rezzed object.</param> | ||
2023 | /// <param name="param"></param> | 2062 | /// <param name="param"></param> |
2024 | /// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful</returns> | 2063 | /// <returns>The SceneObjectGroup rezzed or null if rez was unsuccessful</returns> |
2025 | public virtual SceneObjectGroup RezObject( | 2064 | public virtual SceneObjectGroup RezObject( |
2026 | SceneObjectPart sourcePart, TaskInventoryItem item, | 2065 | SceneObjectPart sourcePart, TaskInventoryItem item, Vector3 pos, Quaternion? rot, Vector3 vel, int param) |
2027 | Vector3 pos, Quaternion rot, Vector3 vel, int param) | ||
2028 | { | 2066 | { |
2029 | if (null == item) | 2067 | if (null == item) |
2030 | return null; | 2068 | return null; |
@@ -2042,8 +2080,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2042 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) | 2080 | if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) |
2043 | sourcePart.Inventory.RemoveInventoryItem(item.ItemID); | 2081 | sourcePart.Inventory.RemoveInventoryItem(item.ItemID); |
2044 | } | 2082 | } |
2045 | 2083 | ||
2046 | AddNewSceneObject(group, true, pos, rot, vel); | 2084 | AddNewSceneObject(group, true); |
2085 | |||
2086 | group.AbsolutePosition = pos; | ||
2087 | group.Velocity = vel; | ||
2088 | |||
2089 | if (rot != null) | ||
2090 | group.UpdateGroupRotationR((Quaternion)rot); | ||
2047 | 2091 | ||
2048 | // We can only call this after adding the scene object, since the scene object references the scene | 2092 | // We can only call this after adding the scene object, since the scene object references the scene |
2049 | // to find out if scripts should be activated at all. | 2093 | // to find out if scripts should be activated at all. |