diff options
author | Teravus Ovares (Dan Olivares) | 2009-10-13 22:03:00 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-10-13 22:03:53 -0400 |
commit | 31a61bbeec5aae6b679ffa53e2966420e774f301 (patch) | |
tree | 19f53c8e089953c5559a311e8836c9ee3880e9a9 /OpenSim/Region | |
parent | Better handling of missing assets. (diff) | |
download | opensim-SC_OLD-31a61bbeec5aae6b679ffa53e2966420e774f301.zip opensim-SC_OLD-31a61bbeec5aae6b679ffa53e2966420e774f301.tar.gz opensim-SC_OLD-31a61bbeec5aae6b679ffa53e2966420e774f301.tar.bz2 opensim-SC_OLD-31a61bbeec5aae6b679ffa53e2966420e774f301.tar.xz |
* Fixes some prim crossings on megaregions with regions beyond the 512m mark
* There's a slight chance that this could cause a problem with regular prim crossings.. but hopefully not. Revert if it does.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 114 |
2 files changed, 99 insertions, 25 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs index 05d19a2..6499915 100644 --- a/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs | |||
@@ -343,7 +343,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
343 | 343 | ||
344 | lock (scene.WestBorders) | 344 | lock (scene.WestBorders) |
345 | { | 345 | { |
346 | scene.WestBorders[0].BorderLine.Z += (int) Constants.RegionSize; //auto teleport West | 346 | |
347 | |||
348 | scene.WestBorders[0].BorderLine.Z = (int)((scene.RegionInfo.RegionLocX - conn.RegionScene.RegionInfo.RegionLocX) * (int)Constants.RegionSize); //auto teleport West | ||
347 | 349 | ||
348 | // Trigger auto teleport to root region | 350 | // Trigger auto teleport to root region |
349 | scene.WestBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; | 351 | scene.WestBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; |
@@ -410,7 +412,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
410 | conn.RegionScene.WestBorders[0].BorderLine.Y += (int)Constants.RegionSize; | 412 | conn.RegionScene.WestBorders[0].BorderLine.Y += (int)Constants.RegionSize; |
411 | lock (scene.SouthBorders) | 413 | lock (scene.SouthBorders) |
412 | { | 414 | { |
413 | scene.SouthBorders[0].BorderLine.Z += (int) Constants.RegionSize; //auto teleport south | 415 | scene.SouthBorders[0].BorderLine.Z = (int)((scene.RegionInfo.RegionLocY - conn.RegionScene.RegionInfo.RegionLocY) * (int)Constants.RegionSize); //auto teleport south |
414 | scene.SouthBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; | 416 | scene.SouthBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; |
415 | scene.SouthBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; | 417 | scene.SouthBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; |
416 | } | 418 | } |
@@ -481,7 +483,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
481 | 483 | ||
482 | lock (scene.SouthBorders) | 484 | lock (scene.SouthBorders) |
483 | { | 485 | { |
484 | scene.SouthBorders[0].BorderLine.Z += (int) Constants.RegionSize; //auto teleport south | 486 | scene.SouthBorders[0].BorderLine.Z = (int)((scene.RegionInfo.RegionLocY - conn.RegionScene.RegionInfo.RegionLocY) * (int)Constants.RegionSize); //auto teleport south |
485 | scene.SouthBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; | 487 | scene.SouthBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; |
486 | scene.SouthBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; | 488 | scene.SouthBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; |
487 | } | 489 | } |
@@ -503,7 +505,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
503 | 505 | ||
504 | lock (scene.WestBorders) | 506 | lock (scene.WestBorders) |
505 | { | 507 | { |
506 | scene.WestBorders[0].BorderLine.Z += (int) Constants.RegionSize; //auto teleport West | 508 | scene.WestBorders[0].BorderLine.Z = (int)((scene.RegionInfo.RegionLocX - conn.RegionScene.RegionInfo.RegionLocX) * (int)Constants.RegionSize); //auto teleport West |
507 | scene.WestBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; | 509 | scene.WestBorders[0].TriggerRegionX = conn.RegionScene.RegionInfo.RegionLocX; |
508 | scene.WestBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; | 510 | scene.WestBorders[0].TriggerRegionY = conn.RegionScene.RegionInfo.RegionLocY; |
509 | } | 511 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 949cf19..0f351ce 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1780,36 +1780,86 @@ namespace OpenSim.Region.Framework.Scenes | |||
1780 | 1780 | ||
1781 | Vector3 pos = attemptedPosition; | 1781 | Vector3 pos = attemptedPosition; |
1782 | 1782 | ||
1783 | int changeX = 1; | ||
1784 | int changeY = 1; | ||
1785 | |||
1783 | if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W)) | 1786 | if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W)) |
1784 | { | 1787 | { |
1785 | if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) | 1788 | if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) |
1786 | { | 1789 | { |
1787 | //Border crossedBorderx = GetCrossedBorder(attemptedPosition,Cardinals.W); | 1790 | |
1788 | //Border crossedBordery = GetCrossedBorder(attemptedPosition, Cardinals.S); | 1791 | Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); |
1792 | |||
1793 | if (crossedBorderx.BorderLine.Z > 0) | ||
1794 | { | ||
1795 | pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); | ||
1796 | changeX = (int)(crossedBorderx.BorderLine.Z /(int) Constants.RegionSize); | ||
1797 | } | ||
1798 | else | ||
1799 | pos.X = ((pos.X + Constants.RegionSize)); | ||
1800 | |||
1801 | Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); | ||
1789 | //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) | 1802 | //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) |
1790 | pos.X = ((pos.X + Constants.RegionSize)); | 1803 | |
1791 | pos.Y = ((pos.Y + Constants.RegionSize)); | 1804 | if (crossedBordery.BorderLine.Z > 0) |
1805 | { | ||
1806 | pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); | ||
1807 | } | ||
1808 | else | ||
1809 | pos.Y = ((pos.Y + Constants.RegionSize)); | ||
1810 | |||
1811 | |||
1812 | |||
1792 | newRegionHandle | 1813 | newRegionHandle |
1793 | = Util.UIntsToLong((uint)((thisx - 1) * Constants.RegionSize), | 1814 | = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), |
1794 | (uint)((thisy - 1) * Constants.RegionSize)); | 1815 | (uint)((thisy - changeY) * Constants.RegionSize)); |
1795 | // x - 1 | 1816 | // x - 1 |
1796 | // y - 1 | 1817 | // y - 1 |
1797 | } | 1818 | } |
1798 | else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) | 1819 | else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) |
1799 | { | 1820 | { |
1800 | pos.X = ((pos.X + Constants.RegionSize)); | 1821 | Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); |
1801 | pos.Y = ((pos.Y - Constants.RegionSize)); | 1822 | |
1823 | if (crossedBorderx.BorderLine.Z > 0) | ||
1824 | { | ||
1825 | pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); | ||
1826 | changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize); | ||
1827 | } | ||
1828 | else | ||
1829 | pos.X = ((pos.X + Constants.RegionSize)); | ||
1830 | |||
1831 | |||
1832 | Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); | ||
1833 | //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) | ||
1834 | |||
1835 | if (crossedBordery.BorderLine.Z > 0) | ||
1836 | { | ||
1837 | pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); | ||
1838 | changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); | ||
1839 | } | ||
1840 | else | ||
1841 | pos.Y = ((pos.Y + Constants.RegionSize)); | ||
1842 | |||
1802 | newRegionHandle | 1843 | newRegionHandle |
1803 | = Util.UIntsToLong((uint)((thisx - 1) * Constants.RegionSize), | 1844 | = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), |
1804 | (uint)((thisy + 1) * Constants.RegionSize)); | 1845 | (uint)((thisy + changeY) * Constants.RegionSize)); |
1805 | // x - 1 | 1846 | // x - 1 |
1806 | // y + 1 | 1847 | // y + 1 |
1807 | } | 1848 | } |
1808 | else | 1849 | else |
1809 | { | 1850 | { |
1810 | pos.X = ((pos.X + Constants.RegionSize)); | 1851 | Border crossedBorderx = GetCrossedBorder(attemptedPosition + WestCross, Cardinals.W); |
1852 | |||
1853 | if (crossedBorderx.BorderLine.Z > 0) | ||
1854 | { | ||
1855 | pos.X = ((pos.X + crossedBorderx.BorderLine.Z)); | ||
1856 | changeX = (int)(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize); | ||
1857 | } | ||
1858 | else | ||
1859 | pos.X = ((pos.X + Constants.RegionSize)); | ||
1860 | |||
1811 | newRegionHandle | 1861 | newRegionHandle |
1812 | = Util.UIntsToLong((uint) ((thisx - 1)*Constants.RegionSize), | 1862 | = Util.UIntsToLong((uint)((thisx - changeX) * Constants.RegionSize), |
1813 | (uint) (thisy*Constants.RegionSize)); | 1863 | (uint) (thisy*Constants.RegionSize)); |
1814 | // x - 1 | 1864 | // x - 1 |
1815 | } | 1865 | } |
@@ -1818,11 +1868,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
1818 | { | 1868 | { |
1819 | if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) | 1869 | if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) |
1820 | { | 1870 | { |
1871 | |||
1821 | pos.X = ((pos.X - Constants.RegionSize)); | 1872 | pos.X = ((pos.X - Constants.RegionSize)); |
1822 | pos.Y = ((pos.Y + Constants.RegionSize)); | 1873 | Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); |
1874 | //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) | ||
1875 | |||
1876 | if (crossedBordery.BorderLine.Z > 0) | ||
1877 | { | ||
1878 | pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); | ||
1879 | changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); | ||
1880 | } | ||
1881 | else | ||
1882 | pos.Y = ((pos.Y + Constants.RegionSize)); | ||
1883 | |||
1884 | |||
1823 | newRegionHandle | 1885 | newRegionHandle |
1824 | = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), | 1886 | = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), |
1825 | (uint)((thisy - 1) * Constants.RegionSize)); | 1887 | (uint)((thisy - changeY) * Constants.RegionSize)); |
1826 | // x + 1 | 1888 | // x + 1 |
1827 | // y - 1 | 1889 | // y - 1 |
1828 | } | 1890 | } |
@@ -1831,8 +1893,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1831 | pos.X = ((pos.X - Constants.RegionSize)); | 1893 | pos.X = ((pos.X - Constants.RegionSize)); |
1832 | pos.Y = ((pos.Y - Constants.RegionSize)); | 1894 | pos.Y = ((pos.Y - Constants.RegionSize)); |
1833 | newRegionHandle | 1895 | newRegionHandle |
1834 | = Util.UIntsToLong((uint)((thisx + 1) * Constants.RegionSize), | 1896 | = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), |
1835 | (uint)((thisy + 1) * Constants.RegionSize)); | 1897 | (uint)((thisy + changeY) * Constants.RegionSize)); |
1836 | // x + 1 | 1898 | // x + 1 |
1837 | // y + 1 | 1899 | // y + 1 |
1838 | } | 1900 | } |
@@ -1840,16 +1902,26 @@ namespace OpenSim.Region.Framework.Scenes | |||
1840 | { | 1902 | { |
1841 | pos.X = ((pos.X - Constants.RegionSize)); | 1903 | pos.X = ((pos.X - Constants.RegionSize)); |
1842 | newRegionHandle | 1904 | newRegionHandle |
1843 | = Util.UIntsToLong((uint) ((thisx + 1)*Constants.RegionSize), | 1905 | = Util.UIntsToLong((uint)((thisx + changeX) * Constants.RegionSize), |
1844 | (uint) (thisy*Constants.RegionSize)); | 1906 | (uint) (thisy*Constants.RegionSize)); |
1845 | // x + 1 | 1907 | // x + 1 |
1846 | } | 1908 | } |
1847 | } | 1909 | } |
1848 | else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) | 1910 | else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) |
1849 | { | 1911 | { |
1850 | pos.Y = ((pos.Y + Constants.RegionSize)); | 1912 | Border crossedBordery = GetCrossedBorder(attemptedPosition + SouthCross, Cardinals.S); |
1913 | //(crossedBorderx.BorderLine.Z / (int)Constants.RegionSize) | ||
1914 | |||
1915 | if (crossedBordery.BorderLine.Z > 0) | ||
1916 | { | ||
1917 | pos.Y = ((pos.Y + crossedBordery.BorderLine.Z)); | ||
1918 | changeY = (int)(crossedBordery.BorderLine.Z / (int)Constants.RegionSize); | ||
1919 | } | ||
1920 | else | ||
1921 | pos.Y = ((pos.Y + Constants.RegionSize)); | ||
1922 | |||
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 | else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) | 1927 | else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) |
@@ -1857,7 +1929,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1857 | 1929 | ||
1858 | pos.Y = ((pos.Y - Constants.RegionSize)); | 1930 | pos.Y = ((pos.Y - Constants.RegionSize)); |
1859 | newRegionHandle | 1931 | newRegionHandle |
1860 | = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + 1) * Constants.RegionSize)); | 1932 | = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy + changeY) * Constants.RegionSize)); |
1861 | // y + 1 | 1933 | // y + 1 |
1862 | } | 1934 | } |
1863 | 1935 | ||