aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs26
1 files changed, 22 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 1024857..23fe2d3 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -776,8 +776,20 @@ namespace OpenSim.Region.Framework.Scenes
776 // before the inventory is processed in MakeRootAgent. This fixes a race condition 776 // before the inventory is processed in MakeRootAgent. This fixes a race condition
777 // related to the handling of attachments 777 // related to the handling of attachments
778 //m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); 778 //m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
779 if (m_scene.TestBorderCross(pos, Cardinals.E))
780 {
781 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.E);
782 pos.X = crossedBorder.BorderLine.Z - 1;
783 }
784
785 if (m_scene.TestBorderCross(pos, Cardinals.N))
786 {
787 Border crossedBorder = m_scene.GetCrossedBorder(pos, Cardinals.N);
788 pos.Y = crossedBorder.BorderLine.Z - 1;
789 }
790
779 791
780 if (pos.X < 0 || pos.X >= (int)Constants.RegionSize || pos.Y < 0 || pos.Y >= (int)Constants.RegionSize || pos.Z < 0) 792 if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
781 { 793 {
782 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128); 794 Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
783 795
@@ -795,7 +807,11 @@ namespace OpenSim.Region.Framework.Scenes
795 localAVHeight = m_avHeight; 807 localAVHeight = m_avHeight;
796 } 808 }
797 809
798 float posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y]; 810 float posZLimit = 0;
811
812 if (pos.X <Constants.RegionSize && pos.Y < Constants.RegionSize)
813 posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y];
814
799 float newPosZ = posZLimit + localAVHeight / 2; 815 float newPosZ = posZLimit + localAVHeight / 2;
800 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ))) 816 if (posZLimit >= (pos.Z - (localAVHeight / 2)) && !(Single.IsInfinity(newPosZ) || Single.IsNaN(newPosZ)))
801 { 817 {
@@ -877,6 +893,7 @@ namespace OpenSim.Region.Framework.Scenes
877 m_isChildAgent = true; 893 m_isChildAgent = true;
878 m_scene.SwapRootAgentCount(true); 894 m_scene.SwapRootAgentCount(true);
879 RemoveFromPhysicalScene(); 895 RemoveFromPhysicalScene();
896
880 m_scene.EventManager.TriggerOnMakeChildAgent(this); 897 m_scene.EventManager.TriggerOnMakeChildAgent(this);
881 } 898 }
882 899
@@ -904,7 +921,7 @@ namespace OpenSim.Region.Framework.Scenes
904 bool isFlying = false; 921 bool isFlying = false;
905 if (m_physicsActor != null) 922 if (m_physicsActor != null)
906 isFlying = m_physicsActor.Flying; 923 isFlying = m_physicsActor.Flying;
907 924
908 RemoveFromPhysicalScene(); 925 RemoveFromPhysicalScene();
909 Velocity = new Vector3(0, 0, 0); 926 Velocity = new Vector3(0, 0, 0);
910 AbsolutePosition = pos; 927 AbsolutePosition = pos;
@@ -2412,7 +2429,8 @@ namespace OpenSim.Region.Framework.Scenes
2412 } 2429 }
2413 2430
2414 // followed suggestion from mic bowman. reversed the two lines below. 2431 // followed suggestion from mic bowman. reversed the two lines below.
2415 CheckForBorderCrossing(); 2432 if (m_parentID == 0 && m_physicsActor != null || m_parentID != 0) // Check that we have a physics actor or we're sitting on something
2433 CheckForBorderCrossing();
2416 CheckForSignificantMovement(); // sends update to the modules. 2434 CheckForSignificantMovement(); // sends update to the modules.
2417 } 2435 }
2418 } 2436 }