fix llScriptDanger(); don't call old ScriptDamage on ossl health functions

This commit is contained in:
UbitUmarov
2017-01-21 06:37:29 +00:00
parent 9d61df0887
commit 0a5d6671ce
3 changed files with 48 additions and 53 deletions

View File

@@ -7963,7 +7963,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llScriptDanger(LSL_Vector pos)
{
m_host.AddScriptLPS(1);
bool result = World.ScriptDanger(m_host.LocalId, pos);
bool result = World.LSLScriptDanger(m_host, pos);
if (result)
{
return 1;

View File

@@ -3538,7 +3538,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LSL_Float health = new LSL_Float(-1);
ScenePresence presence = World.GetScenePresence(new UUID(avatar));
if (presence != null) health = presence.Health;
if (presence != null)
health = presence.Health;
return health;
}
@@ -3578,7 +3579,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID avatarId = new UUID(avatar);
ScenePresence presence = World.GetScenePresence(avatarId);
if (presence != null && World.ScriptDanger(m_host.LocalId, m_host.GetWorldPosition()))
if (presence != null)
{
float health = presence.Health;
health += (float)healing;
@@ -3598,7 +3599,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID avatarId = new UUID(avatar);
ScenePresence presence = World.GetScenePresence(avatarId);
if (presence != null && World.ScriptDanger(m_host.LocalId, m_host.GetWorldPosition()))
if (presence != null)
{
if (health > 100.0)
health = 100.0;
@@ -3617,7 +3618,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID avatarId = new UUID(avatar);
ScenePresence presence = World.GetScenePresence(avatarId);
if (presence != null && World.ScriptDanger(m_host.LocalId, m_host.GetWorldPosition()))
if (presence != null)
presence.HealRate = (float)healrate;
}