diff options
author | Mic Bowman | 2011-12-22 16:59:51 -0800 |
---|---|---|
committer | Mic Bowman | 2011-12-22 16:59:51 -0800 |
commit | 456c89a7a30c5c2ec2e228beb717b9c611106364 (patch) | |
tree | 8871461f99f06890cc552b60bf080557f7bf077b /OpenSim/Region/CoreModules | |
parent | fix the UsesPhysics flag to reference the physics flag rather than the tempon... (diff) | |
download | opensim-SC_OLD-456c89a7a30c5c2ec2e228beb717b9c611106364.zip opensim-SC_OLD-456c89a7a30c5c2ec2e228beb717b9c611106364.tar.gz opensim-SC_OLD-456c89a7a30c5c2ec2e228beb717b9c611106364.tar.bz2 opensim-SC_OLD-456c89a7a30c5c2ec2e228beb717b9c611106364.tar.xz |
Fixes some problems with objects that attempt to cross a region boundary
into a region that does not exist. This is particularly problematic for
physical objects where the velocity continues to move them out of the
region causing an infinite number of failed region crossings. The patch
forces an object that fails a crossing to be non-physical and moves it
back into the starting region.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index b9d5d32..098e5cb 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1705,6 +1705,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1705 | uint x = 0, y = 0; | 1705 | uint x = 0, y = 0; |
1706 | Utils.LongToUInts(newRegionHandle, out x, out y); | 1706 | Utils.LongToUInts(newRegionHandle, out x, out y); |
1707 | GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); | 1707 | GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); |
1708 | |||
1709 | if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent)) | ||
1710 | { | ||
1711 | m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID); | ||
1712 | |||
1713 | // We are going to move the object back to the old position so long as the old position | ||
1714 | // is in the region | ||
1715 | oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1); | ||
1716 | oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1); | ||
1717 | oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f); | ||
1718 | |||
1719 | grp.RootPart.GroupPosition = oldGroupPosition; | ||
1720 | |||
1721 | // Need to turn off the physics flags, otherwise the object will continue to attempt to | ||
1722 | // move out of the region creating an infinite loop of failed attempts to cross | ||
1723 | grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false); | ||
1724 | |||
1725 | grp.ScheduleGroupForFullUpdate(); | ||
1726 | } | ||
1727 | |||
1728 | |||
1729 | |||
1730 | |||
1731 | |||
1708 | if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) | 1732 | if (destination != null && !CrossPrimGroupIntoNewRegion(destination, grp, silent)) |
1709 | { | 1733 | { |
1710 | grp.RootPart.GroupPosition = oldGroupPosition; | 1734 | grp.RootPart.GroupPosition = oldGroupPosition; |