aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World/Land/LandObject.cs
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-08-07 20:31:48 -0400
committerTeravus Ovares (Dan Olivares)2009-08-07 20:31:48 -0400
commit2b990a61bfa88e13d5ad19602e6acef751ea473c (patch)
treed7cf9705923c940646e2db3af67bdb98944d9392 /OpenSim/Region/CoreModules/World/Land/LandObject.cs
parent* Remove hard coded 256 limitations from various places. There's no more 2... (diff)
downloadopensim-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 '')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandObject.cs20
1 files changed, 10 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
index 715b48d..f41bdac 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs
@@ -305,8 +305,8 @@ namespace OpenSim.Region.CoreModules.World.Land
305 try 305 try
306 { 306 {
307 over = 307 over =
308 m_scene.LandChannel.GetLandObject(Util.Clamp<int>((int)Math.Round(avatars[i].AbsolutePosition.X), 0, 255), 308 m_scene.LandChannel.GetLandObject(Util.Clamp<int>((int)Math.Round(avatars[i].AbsolutePosition.X), 0, ((int)Constants.RegionSize - 1)),
309 Util.Clamp<int>((int)Math.Round(avatars[i].AbsolutePosition.Y), 0, 255)); 309 Util.Clamp<int>((int)Math.Round(avatars[i].AbsolutePosition.Y), 0, ((int)Constants.RegionSize - 1)));
310 } 310 }
311 catch (Exception) 311 catch (Exception)
312 { 312 {
@@ -455,21 +455,21 @@ namespace OpenSim.Region.CoreModules.World.Land
455 } 455 }
456 } 456 }
457 int tx = min_x * 4; 457 int tx = min_x * 4;
458 if (tx > 255) 458 if (tx > ((int)Constants.RegionSize - 1))
459 tx = 255; 459 tx = ((int)Constants.RegionSize - 1);
460 int ty = min_y * 4; 460 int ty = min_y * 4;
461 if (ty > 255) 461 if (ty > ((int)Constants.RegionSize - 1))
462 ty = 255; 462 ty = ((int)Constants.RegionSize - 1);
463 landData.AABBMin = 463 landData.AABBMin =
464 new Vector3((float) (min_x * 4), (float) (min_y * 4), 464 new Vector3((float) (min_x * 4), (float) (min_y * 4),
465 (float) m_scene.Heightmap[tx, ty]); 465 (float) m_scene.Heightmap[tx, ty]);
466 466
467 tx = max_x * 4; 467 tx = max_x * 4;
468 if (tx > 255) 468 if (tx > ((int)Constants.RegionSize - 1))
469 tx = 255; 469 tx = ((int)Constants.RegionSize - 1);
470 ty = max_y * 4; 470 ty = max_y * 4;
471 if (ty > 255) 471 if (ty > ((int)Constants.RegionSize - 1))
472 ty = 255; 472 ty = ((int)Constants.RegionSize - 1);
473 landData.AABBMax = 473 landData.AABBMax =
474 new Vector3((float) (max_x * 4), (float) (max_y * 4), 474 new Vector3((float) (max_x * 4), (float) (max_y * 4),
475 (float) m_scene.Heightmap[tx, ty]); 475 (float) m_scene.Heightmap[tx, ty]);