diff options
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 275aa2a..05d18da 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -963,6 +963,27 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
963 | return wasLimited; | 963 | return wasLimited; |
964 | } | 964 | } |
965 | 965 | ||
966 | private bool EnforceEstateLimits(int startX, int startY, int endX, int endY) | ||
967 | { | ||
968 | TerrainData terrData = m_channel.GetTerrainData(); | ||
969 | |||
970 | bool wasLimited = false; | ||
971 | for (int x = startX; x <= endX; x += Constants.TerrainPatchSize) | ||
972 | { | ||
973 | for (int y = startX; y <= endY; y += Constants.TerrainPatchSize) | ||
974 | { | ||
975 | if (terrData.IsTaintedAt(x, y, false /* clearOnTest */)) | ||
976 | { | ||
977 | // If we should respect the estate settings then | ||
978 | // fixup and height deltas that don't respect them. | ||
979 | // Note that LimitChannelChanges() modifies the TerrainChannel with the limited height values. | ||
980 | wasLimited |= LimitChannelChanges(terrData, x, y); | ||
981 | } | ||
982 | } | ||
983 | } | ||
984 | return wasLimited; | ||
985 | } | ||
986 | |||
966 | /// <summary> | 987 | /// <summary> |
967 | /// Checks to see height deltas in the tainted terrain patch at xStart ,yStart | 988 | /// Checks to see height deltas in the tainted terrain patch at xStart ,yStart |
968 | /// are all within the current estate limits | 989 | /// are all within the current estate limits |
@@ -1341,7 +1362,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1341 | 1362 | ||
1342 | //block changes outside estate limits | 1363 | //block changes outside estate limits |
1343 | if (!god) | 1364 | if (!god) |
1344 | EnforceEstateLimits(); | 1365 | EnforceEstateLimits(startX, endX, startY, endY); |
1345 | } | 1366 | } |
1346 | } | 1367 | } |
1347 | else | 1368 | else |
@@ -1404,7 +1425,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1404 | 1425 | ||
1405 | //block changes outside estate limits | 1426 | //block changes outside estate limits |
1406 | if (!god) | 1427 | if (!god) |
1407 | EnforceEstateLimits(); | 1428 | EnforceEstateLimits(startX, endX, startY, endY); |
1408 | } | 1429 | } |
1409 | } | 1430 | } |
1410 | else | 1431 | else |