From e46248ab17d56ec25c6b7495c23afe98838a89b6 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 13 Aug 2008 14:13:46 +0000 Subject: Thank you, tyre, for a patch that fixes a null reference in LSL function llOverMyLand(). --- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs') diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 41703cd..cef9cbf 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -4241,26 +4241,25 @@ namespace OpenSim.Region.ScriptEngine.Common public LSL_Types.LSLInteger llOverMyLand(string id) { - m_host.AddScriptLPS(1); LLUUID key = new LLUUID(); if (LLUUID.TryParse(id,out key)) { - SceneObjectPart obj = new SceneObjectPart(); - obj = World.GetSceneObjectPart(World.Entities[key].LocalId); - if (obj.OwnerID == World.GetLandOwner(obj.AbsolutePosition.X, obj.AbsolutePosition.Y)) + ScenePresence presence = World.GetScenePresence(key); + if (presence != null) // object is an avatar { - return 1; + if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) + return 1; } - else + else // object is not an avatar { - return 0; + SceneObjectPart obj = World.GetSceneObjectPart(key); + if (obj != null) + if (m_host.OwnerID == World.GetLandOwner(obj.AbsolutePosition.X, obj.AbsolutePosition.Y)) + return 1; } } - else - { - return 0; - } + return 0; } public string llGetLandOwnerAt(LSL_Types.Vector3 pos) -- cgit v1.1