diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f83a4d2..6a9f016 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -830,41 +830,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
830 | pos.Y = crossedBorder.BorderLine.Z - 1; | 830 | pos.Y = crossedBorder.BorderLine.Z - 1; |
831 | } | 831 | } |
832 | 832 | ||
833 | 833 | if (pos.X < 0f || pos.Y < 0f || pos.Z < 0f) | |
834 | if (pos.X < 0 || pos.Y < 0 || pos.Z < 0) | ||
835 | { | 834 | { |
836 | Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128); | ||
837 | |||
838 | if (pos.X < 0) | ||
839 | { | ||
840 | emergencyPos.X = (int)Constants.RegionSize + pos.X; | ||
841 | if (!(pos.Y < 0)) | ||
842 | emergencyPos.Y = pos.Y; | ||
843 | if (!(pos.Z < 0)) | ||
844 | emergencyPos.X = pos.X; | ||
845 | } | ||
846 | if (pos.Y < 0) | ||
847 | { | ||
848 | emergencyPos.Y = (int)Constants.RegionSize + pos.Y; | ||
849 | if (!(pos.X < 0)) | ||
850 | emergencyPos.X = pos.X; | ||
851 | if (!(pos.Z < 0)) | ||
852 | emergencyPos.Z = pos.Z; | ||
853 | } | ||
854 | if (pos.Z < 0) | ||
855 | { | ||
856 | if (!(pos.X < 0)) | ||
857 | emergencyPos.X = pos.X; | ||
858 | if (!(pos.Y < 0)) | ||
859 | emergencyPos.Y = pos.Y; | ||
860 | //Leave as 128 | ||
861 | } | ||
862 | |||
863 | m_log.WarnFormat( | 835 | m_log.WarnFormat( |
864 | "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", | 836 | "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Clamping", |
865 | pos, Name, UUID, emergencyPos); | 837 | pos, Name, UUID); |
866 | 838 | ||
867 | pos = emergencyPos; | 839 | if (pos.X < 0f) pos.X = 0f; |
840 | if (pos.Y < 0f) pos.Y = 0f; | ||
841 | if (pos.Z < 0f) pos.Z = 0f; | ||
868 | } | 842 | } |
869 | 843 | ||
870 | float localAVHeight = 1.56f; | 844 | float localAVHeight = 1.56f; |
@@ -875,7 +849,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
875 | 849 | ||
876 | float posZLimit = 0; | 850 | float posZLimit = 0; |
877 | 851 | ||
878 | if (pos.X <Constants.RegionSize && pos.Y < Constants.RegionSize) | 852 | if (pos.X < Constants.RegionSize && pos.Y < Constants.RegionSize) |
879 | posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y]; | 853 | posZLimit = (float)m_scene.Heightmap[(int)pos.X, (int)pos.Y]; |
880 | 854 | ||
881 | float newPosZ = posZLimit + localAVHeight / 2; | 855 | float newPosZ = posZLimit + localAVHeight / 2; |