aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-03-14 23:16:39 +0000
committerJustin Clark-Casey (justincc)2013-03-14 23:16:39 +0000
commit0ea0f8aa83eac5ce826483785ac5398286876e17 (patch)
tree9f90c8407c1a86f032008bea098bc702705d9750 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
parentminor: Use more compact libomv primitive constructors in osNpcGetPos() and os... (diff)
downloadopensim-SC-0ea0f8aa83eac5ce826483785ac5398286876e17.zip
opensim-SC-0ea0f8aa83eac5ce826483785ac5398286876e17.tar.gz
opensim-SC-0ea0f8aa83eac5ce826483785ac5398286876e17.tar.bz2
opensim-SC-0ea0f8aa83eac5ce826483785ac5398286876e17.tar.xz
Fix bug in osCauseHealing() if called with an avatar ID for an avatar that is not in the scene.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs22
1 files changed, 9 insertions, 13 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 0ab2733..a6dca61 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -3014,20 +3014,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3014 3014
3015 UUID avatarId = new UUID(avatar); 3015 UUID avatarId = new UUID(avatar);
3016 ScenePresence presence = World.GetScenePresence(avatarId); 3016 ScenePresence presence = World.GetScenePresence(avatarId);
3017 Vector3 pos = m_host.GetWorldPosition(); 3017
3018 bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z)); 3018 if (presence != null && World.ScriptDanger(m_host.LocalId, m_host.GetWorldPosition()))
3019 if (result)
3020 { 3019 {
3021 if (presence != null) 3020 float health = presence.Health;
3022 { 3021 health += (float)healing;
3023 float health = presence.Health; 3022
3024 health += (float)healing; 3023 if (health >= 100)
3025 if (health >= 100) 3024 health = 100;
3026 { 3025
3027 health = 100; 3026 presence.setHealthWithUpdate(health);
3028 }
3029 presence.setHealthWithUpdate(health);
3030 }
3031 } 3027 }
3032 } 3028 }
3033 3029