diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Land')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Land/LandObject.cs | 20 |
2 files changed, 16 insertions, 14 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 | ||
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]); |