aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs17
1 files changed, 14 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 99b2085..22bb9ad 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -588,8 +588,19 @@ namespace OpenSim.Region.Environment.Scenes
588 public void MakeRootAgent(LLVector3 pos, bool isFlying) 588 public void MakeRootAgent(LLVector3 pos, bool isFlying)
589 { 589 {
590// m_log.DebugFormat( 590// m_log.DebugFormat(
591// "[SCENEPRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2}", 591// "[SCENE PRESENCE]: Upgrading child agent {0}, {1} to a root agent in {2} at pos {3}",
592// Name, UUID, m_scene.RegionInfo.RegionName); 592// Name, UUID, m_scene.RegionInfo.RegionName, pos);
593
594 if (pos.X < 0 || pos.X > Constants.RegionSize || pos.Y < 0 || pos.Y > Constants.RegionSize || pos.Z < 0)
595 {
596 LLVector3 emergencyPos = new LLVector3(128, 128, 128);
597
598 m_log.WarnFormat(
599 "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {2}, {3}. Substituting {4}",
600 pos, Name, UUID, emergencyPos);
601
602 pos = emergencyPos;
603 }
593 604
594 m_isChildAgent = false; 605 m_isChildAgent = false;
595 606
@@ -599,7 +610,7 @@ namespace OpenSim.Region.Environment.Scenes
599 localAVHeight = m_avHeight; 610 localAVHeight = m_avHeight;
600 } 611 }
601 612
602 float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y); 613 float posZLimit = (float)m_scene.GetLandHeight((int)pos.X, (int)pos.Y);
603 float newPosZ = posZLimit + localAVHeight; 614 float newPosZ = posZLimit + localAVHeight;
604 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) 615 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
605 { 616 {