diff options
author | Justin Clark-Casey (justincc) | 2011-04-12 18:31:41 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-04-12 18:31:41 +0100 |
commit | 98d7de22dc44ca1e5971301c02a6a1fe49620889 (patch) | |
tree | c9c7eb66ec3d1bb81d0005508e3ec3e87d628a3b /OpenSim | |
parent | minor: add a bit more method doc to IInventoryService.GetItem() (diff) | |
download | opensim-SC-98d7de22dc44ca1e5971301c02a6a1fe49620889.zip opensim-SC-98d7de22dc44ca1e5971301c02a6a1fe49620889.tar.gz opensim-SC-98d7de22dc44ca1e5971301c02a6a1fe49620889.tar.bz2 opensim-SC-98d7de22dc44ca1e5971301c02a6a1fe49620889.tar.xz |
Fix (add) ability to rez objects by dragging them out of another prim's inventory.
This should happen if the client supplies a task ID with the RezObject call.
The rez goes through the same code as llRezObject(), so the same perms are applied.
Rotation isn't yet preserved, this should be fixed shortly.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 59 |
2 files changed, 58 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 9fbfc34..cdee53c 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -552,8 +552,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
552 | /// <summary> | 552 | /// <summary> |
553 | /// Rez an object into the scene from the user's inventory | 553 | /// Rez an object into the scene from the user's inventory |
554 | /// </summary> | 554 | /// </summary> |
555 | /// <remarks> | ||
555 | /// FIXME: It would be really nice if inventory access modules didn't also actually do the work of rezzing | 556 | /// FIXME: It would be really nice if inventory access modules didn't also actually do the work of rezzing |
556 | /// things to the scene. The caller should be doing that, I think. | 557 | /// things to the scene. The caller should be doing that, I think. |
558 | /// </remarks> | ||
557 | /// <param name="remoteClient"></param> | 559 | /// <param name="remoteClient"></param> |
558 | /// <param name="itemID"></param> | 560 | /// <param name="itemID"></param> |
559 | /// <param name="RayEnd"></param> | 561 | /// <param name="RayEnd"></param> |
@@ -570,6 +572,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
570 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, | 572 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, |
571 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) | 573 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) |
572 | { | 574 | { |
575 | // m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID); | ||
576 | |||
573 | // Work out position details | 577 | // Work out position details |
574 | byte bRayEndIsIntersection = (byte)0; | 578 | byte bRayEndIsIntersection = (byte)0; |
575 | 579 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 73dd531..4370850 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1955,11 +1955,60 @@ 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 | // Work out position details | ||
1993 | byte bRayEndIsIntersection = (byte)0; | ||
1994 | |||
1995 | if (RayEndIsIntersection) | ||
1996 | { | ||
1997 | bRayEndIsIntersection = (byte)1; | ||
1998 | } | ||
1999 | else | ||
2000 | { | ||
2001 | bRayEndIsIntersection = (byte)0; | ||
2002 | } | ||
2003 | |||
2004 | Vector3 scale = new Vector3(0.5f, 0.5f, 0.5f); | ||
2005 | Vector3 pos | ||
2006 | = GetNewRezLocation( | ||
2007 | RayStart, RayEnd, RayTargetID, Quaternion.Identity, | ||
2008 | BypassRayCast, bRayEndIsIntersection, true, scale, false); | ||
2009 | |||
2010 | RezObject(part, item, pos, Quaternion.Identity, Vector3.Zero, 0); | ||
2011 | } | ||
1963 | } | 2012 | } |
1964 | 2013 | ||
1965 | /// <summary> | 2014 | /// <summary> |