aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common
diff options
context:
space:
mode:
authorCharles Krinke2008-07-10 03:13:29 +0000
committerCharles Krinke2008-07-10 03:13:29 +0000
commit38da8960e98c12a16bf8a25e9fe7e03ee251933c (patch)
tree2e54441d2bedee44a3a9f0a083dc56e9a290349a /OpenSim/Region/ScriptEngine/Common
parentMantis#1673. Thank you kindly, Matth for a patch that: (diff)
downloadopensim-SC_OLD-38da8960e98c12a16bf8a25e9fe7e03ee251933c.zip
opensim-SC_OLD-38da8960e98c12a16bf8a25e9fe7e03ee251933c.tar.gz
opensim-SC_OLD-38da8960e98c12a16bf8a25e9fe7e03ee251933c.tar.bz2
opensim-SC_OLD-38da8960e98c12a16bf8a25e9fe7e03ee251933c.tar.xz
Mantis#1707. Thank you, Melanie for a patch that:
This patch limits the maximum size of prims that can be created using libsl bots or modified clients to 65536mper side. It also limits LSL functions to that size. If a prim is already physical, the enforced constraint is 10m. A prim that is larger than 10m cannot be turned physical, either via script or UI. Linksets are handled correctly, so scaling of physical linksets is constrained by the size of it's largest component prim. Also, turning linksets physical is based on the size of it's largest ptim.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 2b986be..2538246 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -831,7 +831,24 @@ namespace OpenSim.Region.ScriptEngine.Common
831 if ((status & BuiltIn_Commands_BaseClass.STATUS_PHYSICS) == BuiltIn_Commands_BaseClass.STATUS_PHYSICS) 831 if ((status & BuiltIn_Commands_BaseClass.STATUS_PHYSICS) == BuiltIn_Commands_BaseClass.STATUS_PHYSICS)
832 { 832 {
833 if (value == 1) 833 if (value == 1)
834 {
835 SceneObjectGroup group = m_host.ParentGroup;
836 if(group == null)
837 return;
838 bool allow = true;
839 foreach(SceneObjectPart part in group.Children.Values)
840 {
841 if(part.Scale.X > 10.0 || part.Scale.Y > 10.0 || part.Scale.Z > 10.0)
842 {
843 allow = false;
844 break;
845 }
846 }
847
848 if(!allow)
849 return;
834 m_host.ScriptSetPhysicsStatus(true); 850 m_host.ScriptSetPhysicsStatus(true);
851 }
835 else 852 else
836 m_host.ScriptSetPhysicsStatus(false); 853 m_host.ScriptSetPhysicsStatus(false);
837 854
@@ -948,6 +965,25 @@ namespace OpenSim.Region.ScriptEngine.Common
948 private void SetScale(SceneObjectPart part, LSL_Types.Vector3 scale) 965 private void SetScale(SceneObjectPart part, LSL_Types.Vector3 scale)
949 { 966 {
950 // TODO: this needs to trigger a persistance save as well 967 // TODO: this needs to trigger a persistance save as well
968
969 if(part == null || part.ParentGroup == null || part.ParentGroup.RootPart == null)
970 return;
971
972 if(part.ParentGroup.RootPart.PhysActor != null && part.ParentGroup.RootPart.PhysActor.IsPhysical)
973 {
974 if(scale.x > 10.0)
975 scale.x = 10.0;
976 if(scale.y > 10.0)
977 scale.y = 10.0;
978 if(scale.z > 10.0)
979 scale.z = 10.0;
980 }
981 if(scale.x > 65536.0)
982 scale.x = 65536.0;
983 if(scale.y > 65536.0)
984 scale.y = 65536.0;
985 if(scale.z > 65536.0)
986 scale.z = 65536.0;
951 LLVector3 tmp = part.Scale; 987 LLVector3 tmp = part.Scale;
952 tmp.X = (float)scale.x; 988 tmp.X = (float)scale.x;
953 tmp.Y = (float)scale.y; 989 tmp.Y = (float)scale.y;