diff options
author | TBG Renfold | 2012-08-10 01:29:41 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-08-24 00:13:27 +0100 |
commit | a3cbda0d74a14c05acf04adaaa5b9ff30c6d9fa5 (patch) | |
tree | cd02f717d3e1f3cd78016d30310e880623deb798 | |
parent | Adds osGetHealth. (diff) | |
download | opensim-SC_OLD-a3cbda0d74a14c05acf04adaaa5b9ff30c6d9fa5.zip opensim-SC_OLD-a3cbda0d74a14c05acf04adaaa5b9ff30c6d9fa5.tar.gz opensim-SC_OLD-a3cbda0d74a14c05acf04adaaa5b9ff30c6d9fa5.tar.bz2 opensim-SC_OLD-a3cbda0d74a14c05acf04adaaa5b9ff30c6d9fa5.tar.xz |
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.
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 3d233d7..5e7c2d9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -2901,19 +2901,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2901 | CheckThreatLevel(ThreatLevel.None, "osGetHealth"); | 2901 | CheckThreatLevel(ThreatLevel.None, "osGetHealth"); |
2902 | m_host.AddScriptLPS(1); | 2902 | m_host.AddScriptLPS(1); |
2903 | 2903 | ||
2904 | UUID avatarId = new UUID(avatar); | ||
2905 | Vector3 pos = m_host.GetWorldPosition(); | ||
2906 | |||
2907 | LSL_Float health = new LSL_Float(-1); | 2904 | LSL_Float health = new LSL_Float(-1); |
2908 | ScenePresence presence = World.GetScenePresence(avatarId); | 2905 | ScenePresence presence = World.GetScenePresence(new UUID(avatar)); |
2909 | if (presence != null) | 2906 | if (presence != null) health = presence.Health; |
2910 | { | ||
2911 | LandData land = World.GetLandData((float)pos.X, (float)pos.Y); | ||
2912 | if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage) | ||
2913 | { | ||
2914 | health = presence.Health; | ||
2915 | } | ||
2916 | } | ||
2917 | return health; | 2907 | return health; |
2918 | } | 2908 | } |
2919 | 2909 | ||