aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorSnowcrash2009-10-20 15:51:19 +0200
committerMelanie2009-10-22 17:36:49 +0100
commit47d8b6c5f50a494bca520e2a8532c59561339963 (patch)
treeaac8ef0698c612a11f9ecce98ad3a41a8699e5bf
parent* Added a check if Util.m_ThreadPool is null before trying to use it, and if ... (diff)
downloadopensim-SC-47d8b6c5f50a494bca520e2a8532c59561339963.zip
opensim-SC-47d8b6c5f50a494bca520e2a8532c59561339963.tar.gz
opensim-SC-47d8b6c5f50a494bca520e2a8532c59561339963.tar.bz2
opensim-SC-47d8b6c5f50a494bca520e2a8532c59561339963.tar.xz
Fix rounding error in PRIM_SIZE portion of llSetPrimitiveParams
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 6e17639..c3e89f6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1263,11 +1263,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1263 protected void SetScale(SceneObjectPart part, LSL_Vector scale) 1263 protected void SetScale(SceneObjectPart part, LSL_Vector scale)
1264 { 1264 {
1265 // TODO: this needs to trigger a persistance save as well 1265 // TODO: this needs to trigger a persistance save as well
1266
1267 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) 1266 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
1268 return; 1267 return;
1269 1268 // scale.x < 0.01 in a manner which handles rounding errors
1270 if (scale.x < 0.01 || scale.y < 0.01 || scale.z < 0.01) 1269 if (Math.Round(scale.x - 0.01) > 0.0 || Math.Round(scale.y - 0.01) > 0.0 || Math.Round(scale.z - 0.01) > 0.0)
1271 return; 1270 return;
1272 1271
1273 if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical) 1272 if (part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical)
@@ -1279,12 +1278,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1279 if (scale.z > World.m_maxPhys) 1278 if (scale.z > World.m_maxPhys)
1280 scale.z = World.m_maxPhys; 1279 scale.z = World.m_maxPhys;
1281 } 1280 }
1281
1282 if (scale.x > World.m_maxNonphys) 1282 if (scale.x > World.m_maxNonphys)
1283 scale.x = World.m_maxNonphys; 1283 scale.x = World.m_maxNonphys;
1284 if (scale.y > World.m_maxNonphys) 1284 if (scale.y > World.m_maxNonphys)
1285 scale.y = World.m_maxNonphys; 1285 scale.y = World.m_maxNonphys;
1286 if (scale.z > World.m_maxNonphys) 1286 if (scale.z > World.m_maxNonphys)
1287 scale.z = World.m_maxNonphys; 1287 scale.z = World.m_maxNonphys;
1288
1288 Vector3 tmp = part.Scale; 1289 Vector3 tmp = part.Scale;
1289 tmp.X = (float)scale.x; 1290 tmp.X = (float)scale.x;
1290 tmp.Y = (float)scale.y; 1291 tmp.Y = (float)scale.y;