aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-13 14:13:46 +0000
committerMelanie Thielker2008-08-13 14:13:46 +0000
commite46248ab17d56ec25c6b7495c23afe98838a89b6 (patch)
tree6df03d62541b6417e780633ff8c7a26d833a350f /OpenSim/Region/ScriptEngine/Shared/Api
parentMantis#1925. Thank you, homerHorwitz for a patch that: (diff)
downloadopensim-SC_OLD-e46248ab17d56ec25c6b7495c23afe98838a89b6.zip
opensim-SC_OLD-e46248ab17d56ec25c6b7495c23afe98838a89b6.tar.gz
opensim-SC_OLD-e46248ab17d56ec25c6b7495c23afe98838a89b6.tar.bz2
opensim-SC_OLD-e46248ab17d56ec25c6b7495c23afe98838a89b6.tar.xz
Thank you, tyre, for a patch that fixes a null reference in LSL
function llOverMyLand().
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 17e8253..a8f87b7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4151,26 +4151,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4151 4151
4152 public LSL_Types.LSLInteger llOverMyLand(string id) 4152 public LSL_Types.LSLInteger llOverMyLand(string id)
4153 { 4153 {
4154
4155 m_host.AddScriptLPS(1); 4154 m_host.AddScriptLPS(1);
4156 LLUUID key = new LLUUID(); 4155 LLUUID key = new LLUUID();
4157 if (LLUUID.TryParse(id,out key)) 4156 if (LLUUID.TryParse(id,out key))
4158 { 4157 {
4159 SceneObjectPart obj = new SceneObjectPart(); 4158 ScenePresence presence = World.GetScenePresence(key);
4160 obj = World.GetSceneObjectPart(World.Entities[key].LocalId); 4159 if (presence != null) // object is an avatar
4161 if (obj.OwnerID == World.GetLandOwner(obj.AbsolutePosition.X, obj.AbsolutePosition.Y))
4162 { 4160 {
4163 return 1; 4161 if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y))
4162 return 1;
4164 } 4163 }
4165 else 4164 else // object is not an avatar
4166 { 4165 {
4167 return 0; 4166 SceneObjectPart obj = World.GetSceneObjectPart(key);
4167 if (obj != null)
4168 if (m_host.OwnerID == World.GetLandOwner(obj.AbsolutePosition.X, obj.AbsolutePosition.Y))
4169 return 1;
4168 } 4170 }
4169 } 4171 }
4170 else 4172 return 0;
4171 {
4172 return 0;
4173 }
4174 } 4173 }
4175 4174
4176 public string llGetLandOwnerAt(LSL_Types.Vector3 pos) 4175 public string llGetLandOwnerAt(LSL_Types.Vector3 pos)