diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2ac0805..e03cf17 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2970,37 +2970,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2970 | // need the magnitude later | 2970 | // need the magnitude later |
2971 | // float velmag = (float)Util.GetMagnitude(llvel); | 2971 | // float velmag = (float)Util.GetMagnitude(llvel); |
2972 | 2972 | ||
2973 | SceneObjectGroup new_group = World.RezObject(m_host, item, pos, rot, vel, param); | 2973 | List<SceneObjectGroup> new_groups = World.RezObject(m_host, item, pos, rot, vel, param); |
2974 | 2974 | ||
2975 | // If either of these are null, then there was an unknown error. | 2975 | // If either of these are null, then there was an unknown error. |
2976 | if (new_group == null) | 2976 | if (new_groups == null) |
2977 | return; | 2977 | return; |
2978 | 2978 | ||
2979 | // objects rezzed with this method are die_at_edge by default. | 2979 | foreach (SceneObjectGroup group in new_groups) |
2980 | new_group.RootPart.SetDieAtEdge(true); | 2980 | { |
2981 | // objects rezzed with this method are die_at_edge by default. | ||
2982 | group.RootPart.SetDieAtEdge(true); | ||
2981 | 2983 | ||
2982 | new_group.ResumeScripts(); | 2984 | group.ResumeScripts(); |
2983 | 2985 | ||
2984 | m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams( | 2986 | m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams( |
2985 | "object_rez", new Object[] { | 2987 | "object_rez", new Object[] { |
2986 | new LSL_String( | 2988 | new LSL_String( |
2987 | new_group.RootPart.UUID.ToString()) }, | 2989 | group.RootPart.UUID.ToString()) }, |
2988 | new DetectParams[0])); | 2990 | new DetectParams[0])); |
2989 | 2991 | ||
2990 | float groupmass = new_group.GetMass(); | 2992 | float groupmass = group.GetMass(); |
2991 | 2993 | ||
2992 | PhysicsActor pa = new_group.RootPart.PhysActor; | 2994 | PhysicsActor pa = group.RootPart.PhysActor; |
2993 | 2995 | ||
2994 | //Recoil. | 2996 | //Recoil. |
2995 | if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero) | 2997 | if (pa != null && pa.IsPhysical && (Vector3)vel != Vector3.Zero) |
2996 | { | ||
2997 | Vector3 recoil = -vel * groupmass * m_recoilScaleFactor; | ||
2998 | if (recoil != Vector3.Zero) | ||
2999 | { | 2998 | { |
3000 | llApplyImpulse(recoil, 0); | 2999 | Vector3 recoil = -vel * groupmass * m_recoilScaleFactor; |
3000 | if (recoil != Vector3.Zero) | ||
3001 | { | ||
3002 | llApplyImpulse(recoil, 0); | ||
3003 | } | ||
3001 | } | 3004 | } |
3005 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) | ||
3002 | } | 3006 | } |
3003 | // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay) | ||
3004 | }); | 3007 | }); |
3005 | 3008 | ||
3006 | //ScriptSleep((int)((groupmass * velmag) / 10)); | 3009 | //ScriptSleep((int)((groupmass * velmag) / 10)); |