diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 1309623d2b..574c9af769 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1986,6 +1986,9 @@ namespace OpenSim.Region.Framework.Scenes // If child prims have invalid perms, fix them grp.AdjustChildPrimPermissions(); + // If child prims have invalid perms, fix them + grp.AdjustChildPrimPermissions(); + if (remoteClient == null) { // Autoreturn has a null client. Nothing else does. So diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 04c3184219..a81c39ca98 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2943,6 +2943,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } }); } + + public LSL_Float osGetHealth(string avatar) + { + CheckThreatLevel(ThreatLevel.None, "osGetHealth"); + m_host.AddScriptLPS(1); + + LSL_Float health = new LSL_Float(-1); + ScenePresence presence = World.GetScenePresence(new UUID(avatar)); + if (presence != null) health = presence.Health; + return health; + } public void osCauseDamage(string avatar, double damage) { diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 8c34ed3648..8101da5d37 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -258,6 +258,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces int osGetSimulatorMemory(); void osKickAvatar(string FirstName,string SurName,string alert); void osSetSpeed(string UUID, LSL_Float SpeedModifier); + LSL_Float osGetHealth(string avatar); void osCauseHealing(string avatar, double healing); void osCauseDamage(string avatar, double damage); LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 94405d2b5d..e9131e4655 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -865,7 +865,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase { m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier); } - + + public LSL_Float osGetHealth(string avatar) + { + return m_OSSL_Functions.osGetHealth(avatar); + } + public void osCauseDamage(string avatar, double damage) { m_OSSL_Functions.osCauseDamage(avatar, damage);