diff options
Merge branch 'master' into careminster
Conflicts:
OpenSim/Framework/Servers/BaseOpenSimServer.cs
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index a214935..234ba34 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -372,7 +372,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
372 | //OSSL only may be used if object is in the same group as the parcel | 372 | //OSSL only may be used if object is in the same group as the parcel |
373 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER")) | 373 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_GROUP_MEMBER")) |
374 | { | 374 | { |
375 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 375 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); |
376 | 376 | ||
377 | if (land.LandData.GroupID == m_item.GroupID && land.LandData.GroupID != UUID.Zero) | 377 | if (land.LandData.GroupID == m_item.GroupID && land.LandData.GroupID != UUID.Zero) |
378 | { | 378 | { |
@@ -383,7 +383,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
383 | //Only Parcelowners may use the function | 383 | //Only Parcelowners may use the function |
384 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_OWNER")) | 384 | if (m_FunctionPerms[function].AllowedOwnerClasses.Contains("PARCEL_OWNER")) |
385 | { | 385 | { |
386 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 386 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); |
387 | 387 | ||
388 | if (land.LandData.OwnerID == ownerID) | 388 | if (land.LandData.OwnerID == ownerID) |
389 | { | 389 | { |
@@ -1511,8 +1511,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1511 | 1511 | ||
1512 | m_host.AddScriptLPS(1); | 1512 | m_host.AddScriptLPS(1); |
1513 | 1513 | ||
1514 | ILandObject land | 1514 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); |
1515 | = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | ||
1516 | 1515 | ||
1517 | if (land.LandData.OwnerID != m_host.OwnerID) | 1516 | if (land.LandData.OwnerID != m_host.OwnerID) |
1518 | return; | 1517 | return; |
@@ -1528,8 +1527,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1528 | 1527 | ||
1529 | m_host.AddScriptLPS(1); | 1528 | m_host.AddScriptLPS(1); |
1530 | 1529 | ||
1531 | ILandObject land | 1530 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition); |
1532 | = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | ||
1533 | 1531 | ||
1534 | if (land.LandData.OwnerID != m_host.OwnerID) | 1532 | if (land.LandData.OwnerID != m_host.OwnerID) |
1535 | { | 1533 | { |
@@ -2578,13 +2576,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2578 | ScenePresence sp = World.GetScenePresence(npcId); | 2576 | ScenePresence sp = World.GetScenePresence(npcId); |
2579 | 2577 | ||
2580 | if (sp != null) | 2578 | if (sp != null) |
2581 | { | 2579 | return new LSL_Vector(sp.AbsolutePosition); |
2582 | Vector3 pos = sp.AbsolutePosition; | ||
2583 | return new LSL_Vector(pos.X, pos.Y, pos.Z); | ||
2584 | } | ||
2585 | } | 2580 | } |
2586 | 2581 | ||
2587 | return new LSL_Vector(0, 0, 0); | 2582 | return Vector3.Zero; |
2588 | } | 2583 | } |
2589 | 2584 | ||
2590 | public void osNpcMoveTo(LSL_Key npc, LSL_Vector pos) | 2585 | public void osNpcMoveTo(LSL_Key npc, LSL_Vector pos) |
@@ -2652,7 +2647,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2652 | return new LSL_Rotation(sp.GetWorldRotation()); | 2647 | return new LSL_Rotation(sp.GetWorldRotation()); |
2653 | } | 2648 | } |
2654 | 2649 | ||
2655 | return new LSL_Rotation(Quaternion.Identity.X, Quaternion.Identity.Y, Quaternion.Identity.Z, Quaternion.Identity.W); | 2650 | return Quaternion.Identity; |
2656 | } | 2651 | } |
2657 | 2652 | ||
2658 | public void osNpcSetRot(LSL_Key npc, LSL_Rotation rotation) | 2653 | public void osNpcSetRot(LSL_Key npc, LSL_Rotation rotation) |
@@ -3098,20 +3093,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3098 | 3093 | ||
3099 | UUID avatarId = new UUID(avatar); | 3094 | UUID avatarId = new UUID(avatar); |
3100 | ScenePresence presence = World.GetScenePresence(avatarId); | 3095 | ScenePresence presence = World.GetScenePresence(avatarId); |
3101 | Vector3 pos = m_host.GetWorldPosition(); | 3096 | |
3102 | bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z)); | 3097 | if (presence != null && World.ScriptDanger(m_host.LocalId, m_host.GetWorldPosition())) |
3103 | if (result) | ||
3104 | { | 3098 | { |
3105 | if (presence != null) | 3099 | float health = presence.Health; |
3106 | { | 3100 | health += (float)healing; |
3107 | float health = presence.Health; | 3101 | |
3108 | health += (float)healing; | 3102 | if (health >= 100) |
3109 | if (health >= 100) | 3103 | health = 100; |
3110 | { | 3104 | |
3111 | health = 100; | 3105 | presence.setHealthWithUpdate(health); |
3112 | } | ||
3113 | presence.setHealthWithUpdate(health); | ||
3114 | } | ||
3115 | } | 3106 | } |
3116 | } | 3107 | } |
3117 | 3108 | ||
@@ -3188,8 +3179,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3188 | if (avatar != null && avatar.UUID != m_host.OwnerID) | 3179 | if (avatar != null && avatar.UUID != m_host.OwnerID) |
3189 | { | 3180 | { |
3190 | result.Add(new LSL_String(avatar.UUID.ToString())); | 3181 | result.Add(new LSL_String(avatar.UUID.ToString())); |
3191 | OpenMetaverse.Vector3 ap = avatar.AbsolutePosition; | 3182 | result.Add(new LSL_Vector(avatar.AbsolutePosition)); |
3192 | result.Add(new LSL_Vector(ap.X, ap.Y, ap.Z)); | ||
3193 | result.Add(new LSL_String(avatar.Name)); | 3183 | result.Add(new LSL_String(avatar.Name)); |
3194 | } | 3184 | } |
3195 | }); | 3185 | }); |