aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs114
1 files changed, 93 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1ca0267..9f14761 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1772,36 +1772,86 @@ namespace OpenSim.Region.Framework.Scenes
1772 1772
1773 Vector3 pos = attemptedPosition; 1773 Vector3 pos = attemptedPosition;
1774 1774
1775 int changeX = 1;
1776 int changeY = 1;
1777
1775 if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W)) 1778 if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W))
1776 { 1779 {
1777 if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) 1780 if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
1778 { 1781 {
1779 //Border crossedBorderx = GetCrossedBorder(attemptedPosition,Cardinals.W); 1782
1780 //Border crossedBordery = GetCrossedBorder(attemptedPosition, Cardinals.S); 1783 Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
1784
1785 if (crossedBorderx.BorderLine.Z > 0)
1786 {
1787 pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
1788 changeX = (int)(crossedBorderx.BorderLine.Z /(int) Constants.RegionSize);
1789 }
1790 else
1791 pos.X = ((pos.X + Constants.RegionSize));
1792
1793 Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
1781 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) 1794 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
1782 pos.X = ((pos.X + Constants.RegionSize)); 1795
1783 pos.Y = ((pos.Y + Constants.RegionSize)); 1796 if (crossedBordery.BorderLine.Z > 0)
1797 {
1798 pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
1799 }
1800 else
1801 pos.Y = ((pos.Y + Constants.RegionSize));
1802
1803
1804
1784 newRegionHandle 1805 newRegionHandle
1785 = Util.UIntsToLong((uint)((thisx - 1) * Constants.RegionSize), 1806 = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
1786 (uint)((thisy - 1) * Constants.RegionSize)); 1807 (uint)((thisy - changeY) * Constants.RegionSize));
1787 // x - 1 1808 // x - 1
1788 // y - 1 1809 // y - 1
1789 } 1810 }
1790 else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) 1811 else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N))
1791 { 1812 {
1792 pos.X = ((pos.X + Constants.RegionSize)); 1813 Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
1793 pos.Y = ((pos.Y - Constants.RegionSize)); 1814
1815 if (crossedBorderx.BorderLine.Z > 0)
1816 {
1817 pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
1818 changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize);
1819 }
1820 else
1821 pos.X = ((pos.X + Constants.RegionSize));
1822
1823
1824 Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
1825 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
1826
1827 if (crossedBordery.BorderLine.Z > 0)
1828 {
1829 pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
1830 changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
1831 }
1832 else
1833 pos.Y = ((pos.Y + Constants.RegionSize));
1834
1794 newRegionHandle 1835 newRegionHandle
1795 = Util.UIntsToLong((uint)((thisx - 1) * Constants.RegionSize), 1836 = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
1796 (uint)((thisy + 1) * Constants.RegionSize)); 1837 (uint)((thisy + changeY) * Constants.RegionSize));
1797 // x - 1 1838 // x - 1
1798 // y + 1 1839 // y + 1
1799 } 1840 }
1800 else 1841 else
1801 { 1842 {
1802 pos.X = ((pos.X + Constants.RegionSize)); 1843 Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W);
1844
1845 if (crossedBorderx.BorderLine.Z > 0)
1846 {
1847 pos.X = ((pos.X + crossedBorderx.BorderLine.Z));
1848 changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize);
1849 }
1850 else
1851 pos.X = ((pos.X + Constants.RegionSize));
1852
1803 newRegionHandle 1853 newRegionHandle
1804 = Util.UIntsToLong((uint) ((thisx - 1)*Constants.RegionSize), 1854 = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize),
1805 (uint) (thisy*Constants.RegionSize)); 1855 (uint) (thisy*Constants.RegionSize));
1806 // x - 1 1856 // x - 1
1807 } 1857 }
@@ -1810,11 +1860,23 @@ namespace OpenSim.Region.Framework.Scenes
1810 { 1860 {
1811 if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) 1861 if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
1812 { 1862 {
1863
1813 pos.X = ((pos.X - Constants.RegionSize)); 1864 pos.X = ((pos.X - Constants.RegionSize));
1814 pos.Y = ((pos.Y + Constants.RegionSize)); 1865 Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
1866 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
1867
1868 if (crossedBordery.BorderLine.Z > 0)
1869 {
1870 pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
1871 changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
1872 }
1873 else
1874 pos.Y = ((pos.Y + Constants.RegionSize));
1875
1876
1815 newRegionHandle 1877 newRegionHandle
1816 = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), 1878 = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
1817 (uint)((thisy - 1) * Constants.RegionSize)); 1879 (uint)((thisy - changeY) * Constants.RegionSize));
1818 // x + 1 1880 // x + 1
1819 // y - 1 1881 // y - 1
1820 } 1882 }
@@ -1823,8 +1885,8 @@ namespace OpenSim.Region.Framework.Scenes
1823 pos.X = ((pos.X - Constants.RegionSize)); 1885 pos.X = ((pos.X - Constants.RegionSize));
1824 pos.Y = ((pos.Y - Constants.RegionSize)); 1886 pos.Y = ((pos.Y - Constants.RegionSize));
1825 newRegionHandle 1887 newRegionHandle
1826 = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), 1888 = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
1827 (uint)((thisy + 1) * Constants.RegionSize)); 1889 (uint)((thisy + changeY) * Constants.RegionSize));
1828 // x + 1 1890 // x + 1
1829 // y + 1 1891 // y + 1
1830 } 1892 }
@@ -1832,16 +1894,26 @@ namespace OpenSim.Region.Framework.Scenes
1832 { 1894 {
1833 pos.X = ((pos.X - Constants.RegionSize)); 1895 pos.X = ((pos.X - Constants.RegionSize));
1834 newRegionHandle 1896 newRegionHandle
1835 = Util.UIntsToLong((uint) ((thisx + 1)*Constants.RegionSize), 1897 = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize),
1836 (uint) (thisy*Constants.RegionSize)); 1898 (uint) (thisy*Constants.RegionSize));
1837 // x + 1 1899 // x + 1
1838 } 1900 }
1839 } 1901 }
1840 else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) 1902 else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S))
1841 { 1903 {
1842 pos.Y = ((pos.Y + Constants.RegionSize)); 1904 Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S);
1905 //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize)
1906
1907 if (crossedBordery.BorderLine.Z > 0)
1908 {
1909 pos.Y = ((pos.Y + crossedBordery.BorderLine.Z));
1910 changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize);
1911 }
1912 else
1913 pos.Y = ((pos.Y + Constants.RegionSize));
1914
1843 newRegionHandle 1915 newRegionHandle
1844 = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - 1) * Constants.RegionSize)); 1916 = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - changeY) * Constants.RegionSize));
1845 // y - 1 1917 // y - 1
1846 } 1918 }
1847 else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) 1919 else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N))
@@ -1849,7 +1921,7 @@ namespace OpenSim.Region.Framework.Scenes
1849 1921
1850 pos.Y = ((pos.Y - Constants.RegionSize)); 1922 pos.Y = ((pos.Y - Constants.RegionSize));
1851 newRegionHandle 1923 newRegionHandle
1852 = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + 1) * Constants.RegionSize)); 1924 = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + changeY) * Constants.RegionSize));
1853 // y + 1 1925 // y + 1
1854 } 1926 }
1855 1927