diff options
author | UbitUmarov | 2015-08-27 22:36:14 +0100 |
---|---|---|
committer | UbitUmarov | 2015-08-27 22:36:14 +0100 |
commit | bd4ec5f26c8cc038e5155d6913e5a4601f724271 (patch) | |
tree | 509df6de47dbb47937fe5bbb823697bd85ac8f02 /OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |
parent | remove the rest of #justEditedTerrain, it was sending patchs non (diff) | |
download | opensim-SC_OLD-bd4ec5f26c8cc038e5155d6913e5a4601f724271.zip opensim-SC_OLD-bd4ec5f26c8cc038e5155d6913e5a4601f724271.tar.gz opensim-SC_OLD-bd4ec5f26c8cc038e5155d6913e5a4601f724271.tar.bz2 opensim-SC_OLD-bd4ec5f26c8cc038e5155d6913e5a4601f724271.tar.xz |
restrict terrain PaintBrushes to the requested area
Diffstat (limited to 'OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index a5efeb8..7bae9ec 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -1128,20 +1128,32 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1128 | int zx = (int) (west + 0.5); | 1128 | int zx = (int) (west + 0.5); |
1129 | int zy = (int) (north + 0.5); | 1129 | int zy = (int) (north + 0.5); |
1130 | 1130 | ||
1131 | int dx,dy; | 1131 | |
1132 | for (dx=-n; dx<=n; dx++) | 1132 | int startX = zx - n; |
1133 | if (startX < 0) | ||
1134 | startX = 0; | ||
1135 | |||
1136 | int startY = zy - n; | ||
1137 | if (startY < 0) | ||
1138 | startY = 0; | ||
1139 | |||
1140 | int endX = zx + n; | ||
1141 | if (endX >= m_channel.Width) | ||
1142 | endX = m_channel.Width - 1; | ||
1143 | int endY = zy + n; | ||
1144 | if (endY >= m_channel.Height) | ||
1145 | endY = m_channel.Height - 1; | ||
1146 | |||
1147 | int x, y; | ||
1148 | |||
1149 | for (x = startX; x <= endX; x++) | ||
1133 | { | 1150 | { |
1134 | for (dy=-n; dy<=n; dy++) | 1151 | for (y = startY; y <= endY; y++) |
1135 | { | 1152 | { |
1136 | int x = zx + dx; | 1153 | if (m_scene.Permissions.CanTerraformLand(agentId, new Vector3(x, y, 0))) |
1137 | int y = zy + dy; | ||
1138 | if (x>=0 && y>=0 && x<m_channel.Width && y<m_channel.Height) | ||
1139 | { | 1154 | { |
1140 | if (m_scene.Permissions.CanTerraformLand(agentId, new Vector3(x,y,0))) | 1155 | allowMask[x, y] = true; |
1141 | { | 1156 | allowed = true; |
1142 | allowMask[x, y] = true; | ||
1143 | allowed = true; | ||
1144 | } | ||
1145 | } | 1157 | } |
1146 | } | 1158 | } |
1147 | } | 1159 | } |
@@ -1149,7 +1161,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
1149 | { | 1161 | { |
1150 | StoreUndoState(); | 1162 | StoreUndoState(); |
1151 | m_painteffects[(StandardTerrainEffects) action].PaintEffect( | 1163 | m_painteffects[(StandardTerrainEffects) action].PaintEffect( |
1152 | m_channel, allowMask, west, south, height, size, seconds); | 1164 | m_channel, allowMask, west, south, height, size, seconds, |
1165 | startX, endX, startY, endY); | ||
1153 | 1166 | ||
1154 | //block changes outside estate limits | 1167 | //block changes outside estate limits |
1155 | if (!god) | 1168 | if (!god) |