add osSetHealth() value from 1 to 100; (mantis 7973)

This commit is contained in:
UbitUmarov
2016-07-24 16:31:29 +01:00
parent 37936550f0
commit 2bb467e358
4 changed files with 26 additions and 0 deletions

View File

@@ -3469,6 +3469,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
}
public void osSetHealth(string avatar, double health)
{
CheckThreatLevel(ThreatLevel.High, "osSetHealth");
m_host.AddScriptLPS(1);
UUID avatarId = new UUID(avatar);
ScenePresence presence = World.GetScenePresence(avatarId);
if (presence != null && World.ScriptDanger(m_host.LocalId, m_host.GetWorldPosition()))
{
if (health > 100.0)
health = 100.0;
else if (health < 1.0)
health = 1.0;
presence.setHealthWithUpdate((float)health);
}
}
public LSL_List osGetPrimitiveParams(LSL_Key prim, LSL_List rules)
{
CheckThreatLevel(ThreatLevel.High, "osGetPrimitiveParams");