dont try to cross with avatars on DIE_AT_EDGE or RETURN_AT_EDGE sog

avinationmerge
UbitUmarov 2014-07-22 14:31:47 +01:00
parent 0e4a9e35c7
commit 5269511339
1 changed files with 110 additions and 98 deletions

View File

@ -550,10 +550,18 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 newpos = Vector3.Zero; Vector3 newpos = Vector3.Zero;
OpenSim.Services.Interfaces.GridRegion destination = null; OpenSim.Services.Interfaces.GridRegion destination = null;
if (m_rootPart.DIE_AT_EDGE || m_rootPart.RETURN_AT_EDGE)
{
// this should delete the grp in this case
m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
}
else
{
if (m_rootPart.KeyframeMotion != null) if (m_rootPart.KeyframeMotion != null)
m_rootPart.KeyframeMotion.StartCrossingCheck(); m_rootPart.KeyframeMotion.StartCrossingCheck();
bool canCross = true; bool canCross = true;
foreach (ScenePresence av in m_linkedAvatars) foreach (ScenePresence av in m_linkedAvatars)
{ {
// We need to cross these agents. First, let's find // We need to cross these agents. First, let's find
@ -638,13 +646,15 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence av = avinfo.av; ScenePresence av = avinfo.av;
av.ParentUUID = UUID.Zero; av.ParentUUID = UUID.Zero;
av.ParentID = avinfo.ParentID; av.ParentID = avinfo.ParentID;
// m_linkedAvatars.Add(av); // m_linkedAvatars.Add(av);
} }
} }
avsToCross.Clear(); avsToCross.Clear();
} }
else // else
// we need to do this on all fails
{ {
if (m_rootPart.KeyframeMotion != null) if (m_rootPart.KeyframeMotion != null)
m_rootPart.KeyframeMotion.CrossingFailure(); m_rootPart.KeyframeMotion.CrossingFailure();
@ -657,7 +667,9 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 oldp = AbsolutePosition; Vector3 oldp = AbsolutePosition;
val.X = Util.Clamp<float>(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f); val.X = Util.Clamp<float>(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f);
val.Y = Util.Clamp<float>(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f); val.Y = Util.Clamp<float>(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f);
val.Z = Util.Clamp<float>(oldp.Z, 0.5f, 4096.0f); // dont crash land StarShips
// val.Z = Util.Clamp<float>(oldp.Z, 0.5f, 4096.0f);
}
} }
} }