diff options
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 9a6dfe1..557555d 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1655,35 +1655,38 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1655 | } | 1655 | } |
1656 | 1656 | ||
1657 | // Offset the positions for the new region across the border | 1657 | // Offset the positions for the new region across the border |
1658 | Vector3 oldGroupPosition = grp.RootPart.GroupPosition; | 1658 | // NOT here |
1659 | grp.RootPart.GroupPosition = pos; | ||
1660 | 1659 | ||
1661 | // If we fail to cross the border, then reset the position of the scene object on that border. | 1660 | // If we fail to cross the border, then reset the position of the scene object on that border. |
1662 | uint x = 0, y = 0; | 1661 | uint x = 0, y = 0; |
1663 | Utils.LongToUInts(newRegionHandle, out x, out y); | 1662 | Utils.LongToUInts(newRegionHandle, out x, out y); |
1664 | GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); | 1663 | GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); |
1665 | 1664 | ||
1666 | if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent)) | 1665 | Vector3 oldGroupPosition = grp.RootPart.GroupPosition; |
1666 | |||
1667 | if (destination != null) | ||
1667 | { | 1668 | { |
1668 | m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID); | 1669 | grp.RootPart.GroupPosition = pos; // only change this if we think there is anywhere to go |
1670 | if (CrossPrimGroupIntoNewRegion(destination, grp, silent)) | ||
1671 | return; // we did it | ||
1672 | } | ||
1669 | 1673 | ||
1670 | // Need to turn off the physics flags, otherwise the object will continue to attempt to | 1674 | // no one or failed lets go back and tell physics to go on |
1671 | // move out of the region creating an infinite loop of failed attempts to cross | 1675 | oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X, 0.5f, (float)Constants.RegionSize - 0.5f); |
1672 | grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false); | 1676 | oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y, 0.5f, (float)Constants.RegionSize - 0.5f); |
1677 | oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z, 0.5f, 4096.0f); | ||
1673 | 1678 | ||
1674 | // We are going to move the object back to the old position so long as the old position | 1679 | grp.AbsolutePosition = oldGroupPosition; |
1675 | // is in the region | 1680 | grp.Velocity = Vector3.Zero; |
1676 | oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1); | ||
1677 | oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1); | ||
1678 | oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f); | ||
1679 | 1681 | ||
1680 | grp.AbsolutePosition = oldGroupPosition; | 1682 | if (grp.RootPart.PhysActor != null) |
1683 | grp.RootPart.PhysActor.CrossingFailure(); | ||
1681 | 1684 | ||
1682 | grp.ScheduleGroupForFullUpdate(); | 1685 | grp.ScheduleGroupForFullUpdate(); |
1683 | } | ||
1684 | } | 1686 | } |
1685 | 1687 | ||
1686 | 1688 | ||
1689 | |||
1687 | /// <summary> | 1690 | /// <summary> |
1688 | /// Move the given scene object into a new region | 1691 | /// Move the given scene object into a new region |
1689 | /// </summary> | 1692 | /// </summary> |