From 9a06056c9afee3f8c99c0a9e9513e5274bfcb45e Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Tue, 8 Sep 2009 04:43:00 -0400 Subject: * Fixes a 'take object from mega region' and rez it in a regular region.. and have it appear 5 regions over bug by limiting the stored position in the asset to Constants.RegionSize. The stored position in the asset gets overwritten anyway by the rezzing routine, but at least this way, there's no chance of the objects border crossing before the rezzing routine finishes. --- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 36 +++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index f638386..4ea283f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1620,8 +1620,24 @@ namespace OpenSim.Region.Framework.Scenes { UUID assetID = UUID.Zero; + Vector3 inventoryStoredPosition = new Vector3 + (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize) + ? 250 + : objectGroup.AbsolutePosition.X) + , + (objectGroup.AbsolutePosition.X > (int)Constants.RegionSize) + ? 250 + : objectGroup.AbsolutePosition.X, + objectGroup.AbsolutePosition.Z); + + Vector3 originalPosition = objectGroup.AbsolutePosition; + + objectGroup.AbsolutePosition = inventoryStoredPosition; + string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(objectGroup); + objectGroup.AbsolutePosition = originalPosition; + // Get the user info of the item destination // UUID userID = UUID.Zero; @@ -1683,6 +1699,8 @@ namespace OpenSim.Region.Framework.Scenes { // Deleting someone else's item // + + if (remoteClient == null || objectGroup.OwnerID != remoteClient.AgentId) { @@ -1857,8 +1875,24 @@ namespace OpenSim.Region.Framework.Scenes itemID = UUID.Zero; if (grp != null) { + Vector3 inventoryStoredPosition = new Vector3 + (((grp.AbsolutePosition.X > (int)Constants.RegionSize) + ? 250 + : grp.AbsolutePosition.X) + , + (grp.AbsolutePosition.X > (int)Constants.RegionSize) + ? 250 + : grp.AbsolutePosition.X, + grp.AbsolutePosition.Z); + + Vector3 originalPosition = grp.AbsolutePosition; + + grp.AbsolutePosition = inventoryStoredPosition; + string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp); - + + grp.AbsolutePosition = originalPosition; + AssetBase asset = CreateAsset( grp.GetPartName(grp.LocalId), grp.GetPartDescription(grp.LocalId), -- cgit v1.1