mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
Removed land checking as suggested by SignpostMarv.
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.
This commit is contained in:
committed by
Justin Clark-Casey (justincc)
parent
4f3fabae5b
commit
a3cbda0d74
@@ -2901,19 +2901,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user