diff options
author | Jak Daniels | 2015-11-22 16:02:00 +0000 |
---|---|---|
committer | UbitUmarov | 2015-11-22 17:30:08 +0000 |
commit | 15af6265a1853bb9abe49071717f4102ceac8e01 (patch) | |
tree | 680ad29b1ab8d21e2115bab1d8c03c2b08d29c26 /OpenSim/Region/CoreModules/World | |
parent | change silly Monitor use (diff) | |
download | opensim-SC-15af6265a1853bb9abe49071717f4102ceac8e01.zip opensim-SC-15af6265a1853bb9abe49071717f4102ceac8e01.tar.gz opensim-SC-15af6265a1853bb9abe49071717f4102ceac8e01.tar.bz2 opensim-SC-15af6265a1853bb9abe49071717f4102ceac8e01.tar.xz |
Fixed some stupid math and checks on --bounding-origin and --bounding-size. Bounding origin can of course be negative if it needs to be as we're taking stuff from the (possibly rotated) source region. Bounding size must always be >=0 and <= destination region size.
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index e8973b9..839072e 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -224,44 +224,33 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
224 | if (options.ContainsKey("bounding-origin")) | 224 | if (options.ContainsKey("bounding-origin")) |
225 | { | 225 | { |
226 | Vector3 boOption = (Vector3)options["bounding-origin"]; | 226 | Vector3 boOption = (Vector3)options["bounding-origin"]; |
227 | if (boOption.X >= 0 && boOption.X < m_boundingSize.X | 227 | if (boOption != m_boundingOrigin) |
228 | && boOption.Y >= 0 && boOption.Y < m_boundingSize.Y | ||
229 | && boOption.Z >= 0 && boOption.Z < m_boundingSize.Z) | ||
230 | { | 228 | { |
231 | if (m_boundingOrigin != boOption) | 229 | m_boundingOrigin = boOption; |
232 | { | 230 | m_boundingBox = true; |
233 | m_boundingOrigin = boOption; | ||
234 | m_boundingBox = true; | ||
235 | } | ||
236 | } | 231 | } |
237 | else m_log.InfoFormat("[ARCHIVER]: The bounding cube origin must be within the destination region! Setting to {0}.", m_boundingOrigin.ToString()); | ||
238 | } | 232 | } |
239 | 233 | ||
240 | if (options.ContainsKey("bounding-size")) | 234 | if (options.ContainsKey("bounding-size")) |
241 | { | 235 | { |
242 | Vector3 bsOption = (Vector3)options["bounding-size"]; | 236 | Vector3 bsOption = (Vector3)options["bounding-size"]; |
243 | bool clip = false; | 237 | bool clip = false; |
244 | if (bsOption.X <= 0 && bsOption.X > (m_boundingSize.X - m_boundingOrigin.X)) | 238 | if (bsOption.X <= 0 || bsOption.X > m_boundingSize.X) |
245 | { | ||
246 | bsOption.X = m_boundingSize.X - m_boundingOrigin.X; | ||
247 | clip = true; | ||
248 | } | ||
249 | if (bsOption.Y <= 0 && bsOption.Y > (m_boundingSize.Y - m_boundingOrigin.Y)) | ||
250 | { | 239 | { |
251 | bsOption.Y = m_boundingSize.Y - m_boundingOrigin.Y; | 240 | bsOption.X = m_boundingSize.X; |
252 | clip = true; | 241 | clip = true; |
253 | } | 242 | } |
254 | if (bsOption.Z <= 0 && bsOption.Z > (m_boundingSize.Z - m_boundingOrigin.Z)) | 243 | if (bsOption.Y <= 0 || bsOption.Y > m_boundingSize.Y) |
255 | { | 244 | { |
256 | bsOption.Z = m_boundingSize.Y - m_boundingOrigin.Z; | 245 | bsOption.Y = m_boundingSize.Y; |
257 | clip = true; | 246 | clip = true; |
258 | } | 247 | } |
259 | if (m_boundingSize != bsOption) | 248 | if (bsOption != m_boundingSize) |
260 | { | 249 | { |
261 | m_boundingSize = bsOption; | 250 | m_boundingSize = bsOption; |
262 | m_boundingBox = true; | 251 | m_boundingBox = true; |
263 | if (clip) m_log.InfoFormat("[ARCHIVER]: The bounding cube specified is larger than the destination region! Clipping to {0}.", m_boundingSize.ToString()); | ||
264 | } | 252 | } |
253 | if (clip) m_log.InfoFormat("[ARCHIVER]: The bounding cube specified is larger than the destination region! Clipping to {0}.", m_boundingSize.ToString()); | ||
265 | } | 254 | } |
266 | 255 | ||
267 | m_debug = options.ContainsKey("debug"); | 256 | m_debug = options.ContainsKey("debug"); |