diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-07 20:31:48 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-07 20:31:48 -0400 |
commit | 2b990a61bfa88e13d5ad19602e6acef751ea473c (patch) | |
tree | d7cf9705923c940646e2db3af67bdb98944d9392 /OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |
parent | * Remove hard coded 256 limitations from various places. There's no more 2... (diff) | |
download | opensim-SC_OLD-2b990a61bfa88e13d5ad19602e6acef751ea473c.zip opensim-SC_OLD-2b990a61bfa88e13d5ad19602e6acef751ea473c.tar.gz opensim-SC_OLD-2b990a61bfa88e13d5ad19602e6acef751ea473c.tar.bz2 opensim-SC_OLD-2b990a61bfa88e13d5ad19602e6acef751ea473c.tar.xz |
This is the second part of the 'not crash on regionsize changes'. This lets you configure region sizes to be smaller without crashing the region. I remind you that regions are still square, must be a multiple of 4, and the Linden client doesn't like anything other then 256. If you set it bigger or smaller, the terrain doesn't load in the client, the map has issues, and god forbid you connect it to a grid that expects 256m regions.
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 4deb36e..097a62d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -317,8 +317,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
317 | 317 | ||
318 | public void SendLandUpdate(ScenePresence avatar, bool force) | 318 | public void SendLandUpdate(ScenePresence avatar, bool force) |
319 | { | 319 | { |
320 | ILandObject over = GetLandObject((int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), | 320 | ILandObject over = GetLandObject((int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.X))), |
321 | (int)Math.Min(255, Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); | 321 | (int)Math.Min(((int)Constants.RegionSize - 1), Math.Max(0, Math.Round(avatar.AbsolutePosition.Y)))); |
322 | 322 | ||
323 | if (over != null) | 323 | if (over != null) |
324 | { | 324 | { |
@@ -849,10 +849,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
849 | byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET]; | 849 | byte[] byteArray = new byte[LAND_BLOCKS_PER_PACKET]; |
850 | int byteArrayCount = 0; | 850 | int byteArrayCount = 0; |
851 | int sequenceID = 0; | 851 | int sequenceID = 0; |
852 | int blockmeters = 4 * (int) Constants.RegionSize/(int)Constants.TerrainPatchSize; | ||
852 | 853 | ||
853 | for (int y = 0; y < 64; y++) | 854 | |
855 | for (int y = 0; y < blockmeters; y++) | ||
854 | { | 856 | { |
855 | for (int x = 0; x < 64; x++) | 857 | for (int x = 0; x < blockmeters; x++) |
856 | { | 858 | { |
857 | byte tempByte = 0; //This represents the byte for the current 4x4 | 859 | byte tempByte = 0; //This represents the byte for the current 4x4 |
858 | 860 | ||