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 +++++++++++++++++++++- OpenSim/Region/Framework/Scenes/Scene.cs | 17 ++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) (limited to 'OpenSim') 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), diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 3b91dd0..d43a7e2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4256,7 +4256,24 @@ namespace OpenSim.Region.Framework.Scenes break; case 2: // Sell a copy + + + Vector3 inventoryStoredPosition = new Vector3 + (((group.AbsolutePosition.X > (int)Constants.RegionSize) + ? 250 + : group.AbsolutePosition.X) + , + (group.AbsolutePosition.X > (int)Constants.RegionSize) + ? 250 + : group.AbsolutePosition.X, + group.AbsolutePosition.Z); + + Vector3 originalPosition = group.AbsolutePosition; + + group.AbsolutePosition = inventoryStoredPosition; + string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(group); + group.AbsolutePosition = originalPosition; uint perms=group.GetEffectivePermissions(); -- cgit v1.1