diff options
author | UbitUmarov | 2012-06-08 15:27:21 +0100 |
---|---|---|
committer | UbitUmarov | 2012-06-08 15:27:21 +0100 |
commit | f0a6ec151aabbc7ee70ef3461722926c1c0c53e3 (patch) | |
tree | ef39cd0ef7b72af5853e4565fb4574bd2bbbe0e4 /OpenSim/Region/ScriptEngine/Shared | |
parent | *UNTESTED* added PRIM_POS_LOCAL and PRIM_ROT_LOCAL in SetPrimParams for avata... (diff) | |
download | opensim-SC-f0a6ec151aabbc7ee70ef3461722926c1c0c53e3.zip opensim-SC-f0a6ec151aabbc7ee70ef3461722926c1c0c53e3.tar.gz opensim-SC-f0a6ec151aabbc7ee70ef3461722926c1c0c53e3.tar.bz2 opensim-SC-f0a6ec151aabbc7ee70ef3461722926c1c0c53e3.tar.xz |
*UNTESTED* let SetPrimParams for avatars parse even unsupported parameters so that if a supported one is in the middle of then it still works.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 86 |
1 files changed, 84 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d230b24..cb13855 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -7843,7 +7843,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7843 | protected void SetPrimParams(ScenePresence av, LSL_List rules) | 7843 | protected void SetPrimParams(ScenePresence av, LSL_List rules) |
7844 | { | 7844 | { |
7845 | //This is a special version of SetPrimParams to deal with avatars which are sat on the linkset. | 7845 | //This is a special version of SetPrimParams to deal with avatars which are sat on the linkset. |
7846 | //We only support PRIM_POSITION and PRIM_ROTATION | ||
7847 | 7846 | ||
7848 | int idx = 0; | 7847 | int idx = 0; |
7849 | 7848 | ||
@@ -7878,7 +7877,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7878 | v /= localRot; | 7877 | v /= localRot; |
7879 | 7878 | ||
7880 | LSL_Vector sitOffset = (llRot2Up(new LSL_Rotation(av.Rotation.X, av.Rotation.Y, av.Rotation.Z, av.Rotation.W)) * av.Appearance.AvatarHeight * 0.02638f); | 7879 | LSL_Vector sitOffset = (llRot2Up(new LSL_Rotation(av.Rotation.X, av.Rotation.Y, av.Rotation.Z, av.Rotation.W)) * av.Appearance.AvatarHeight * 0.02638f); |
7881 | 7880 | ||
7882 | v = v + 2 * sitOffset; | 7881 | v = v + 2 * sitOffset; |
7883 | 7882 | ||
7884 | av.OffsetPosition = new Vector3((float)v.x, (float)v.y, (float)v.z); | 7883 | av.OffsetPosition = new Vector3((float)v.x, (float)v.y, (float)v.z); |
@@ -7941,6 +7940,89 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7941 | } | 7940 | } |
7942 | break; | 7941 | break; |
7943 | 7942 | ||
7943 | // parse rest doing nothing but number of parameters error check | ||
7944 | case (int)ScriptBaseClass.PRIM_SIZE: | ||
7945 | case (int)ScriptBaseClass.PRIM_MATERIAL: | ||
7946 | case (int)ScriptBaseClass.PRIM_PHANTOM: | ||
7947 | case (int)ScriptBaseClass.PRIM_PHYSICS: | ||
7948 | case (int)ScriptBaseClass.PRIM_PHYSICS_SHAPE_TYPE: | ||
7949 | case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ: | ||
7950 | case (int)ScriptBaseClass.PRIM_NAME: | ||
7951 | case (int)ScriptBaseClass.PRIM_DESC: | ||
7952 | if (remain < 1) | ||
7953 | return; | ||
7954 | idx++; | ||
7955 | break; | ||
7956 | |||
7957 | case (int)ScriptBaseClass.PRIM_GLOW: | ||
7958 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: | ||
7959 | case (int)ScriptBaseClass.PRIM_TEXGEN: | ||
7960 | if (remain < 2) | ||
7961 | return; | ||
7962 | idx += 2; | ||
7963 | break; | ||
7964 | |||
7965 | case (int)ScriptBaseClass.PRIM_TYPE: | ||
7966 | if (remain < 3) | ||
7967 | return; | ||
7968 | code = (int)rules.GetLSLIntegerItem(idx++); | ||
7969 | remain = rules.Length - idx; | ||
7970 | switch (code) | ||
7971 | { | ||
7972 | case (int)ScriptBaseClass.PRIM_TYPE_BOX: | ||
7973 | case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: | ||
7974 | case (int)ScriptBaseClass.PRIM_TYPE_PRISM: | ||
7975 | if (remain < 6) | ||
7976 | return; | ||
7977 | idx += 6; | ||
7978 | break; | ||
7979 | |||
7980 | case (int)ScriptBaseClass.PRIM_TYPE_SPHERE: | ||
7981 | if (remain < 5) | ||
7982 | return; | ||
7983 | idx += 5; | ||
7984 | break; | ||
7985 | |||
7986 | case (int)ScriptBaseClass.PRIM_TYPE_TORUS: | ||
7987 | case (int)ScriptBaseClass.PRIM_TYPE_TUBE: | ||
7988 | case (int)ScriptBaseClass.PRIM_TYPE_RING: | ||
7989 | if (remain < 11) | ||
7990 | return; | ||
7991 | idx += 11; | ||
7992 | break; | ||
7993 | |||
7994 | case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: | ||
7995 | if (remain < 2) | ||
7996 | return; | ||
7997 | idx += 2; | ||
7998 | break; | ||
7999 | } | ||
8000 | break; | ||
8001 | |||
8002 | case (int)ScriptBaseClass.PRIM_COLOR: | ||
8003 | case (int)ScriptBaseClass.PRIM_TEXT: | ||
8004 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | ||
8005 | case (int)ScriptBaseClass.PRIM_OMEGA: | ||
8006 | case (int)ScriptBaseClass.PRIM_LINK_TARGET: | ||
8007 | if (remain < 3) | ||
8008 | return; | ||
8009 | idx += 3; | ||
8010 | break; | ||
8011 | |||
8012 | case (int)ScriptBaseClass.PRIM_TEXTURE: | ||
8013 | case (int)ScriptBaseClass.PRIM_POINT_LIGHT: | ||
8014 | case (int)ScriptBaseClass.PRIM_PHYSICS_MATERIAL: | ||
8015 | if (remain < 5) | ||
8016 | return; | ||
8017 | idx += 5; | ||
8018 | break; | ||
8019 | |||
8020 | case (int)ScriptBaseClass.PRIM_FLEXIBLE: | ||
8021 | if (remain < 7) | ||
8022 | return; | ||
8023 | |||
8024 | idx += 7; | ||
8025 | break; | ||
7944 | } | 8026 | } |
7945 | } | 8027 | } |
7946 | } | 8028 | } |