Skip to content

Commit

Permalink
Removed land checking as suggested by SignpostMarv.
Browse files Browse the repository at this point in the history
Now whatever remaining health the avatar has is displayed (float).
This will be 100% (100.000000) if no damage has occurred (as what the viewer should really be seeing anyway).

Returns -1.000000 if the avatar is not found.
  • Loading branch information
TBG Renfold authored and Justin Clark-Casey (justincc) committed Aug 23, 2012
1 parent 4f3faba commit a3cbda0
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
Expand Up @@ -2901,19 +2901,9 @@ public LSL_Float osGetHealth(string avatar)
CheckThreatLevel(ThreatLevel.None, "osGetHealth");
m_host.AddScriptLPS(1);

UUID avatarId = new UUID(avatar);
Vector3 pos = m_host.GetWorldPosition();

LSL_Float health = new LSL_Float(-1);
ScenePresence presence = World.GetScenePresence(avatarId);
if (presence != null)
{
LandData land = World.GetLandData((float)pos.X, (float)pos.Y);
if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage)
{
health = presence.Health;
}
}
ScenePresence presence = World.GetScenePresence(new UUID(avatar));
if (presence != null) health = presence.Health;
return health;
}

Expand Down

0 comments on commit a3cbda0

Please sign in to comment.