diff options
author | Melanie Thielker | 2008-08-13 14:13:46 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-08-13 14:13:46 +0000 |
commit | e46248ab17d56ec25c6b7495c23afe98838a89b6 (patch) | |
tree | 6df03d62541b6417e780633ff8c7a26d833a350f /OpenSim/Region/ScriptEngine/Common | |
parent | Mantis#1925. Thank you, homerHorwitz for a patch that: (diff) | |
download | opensim-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/Common')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 21 |
1 files changed, 10 insertions, 11 deletions
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 | |||
4241 | 4241 | ||
4242 | public LSL_Types.LSLInteger llOverMyLand(string id) | 4242 | public LSL_Types.LSLInteger llOverMyLand(string id) |
4243 | { | 4243 | { |
4244 | |||
4245 | m_host.AddScriptLPS(1); | 4244 | m_host.AddScriptLPS(1); |
4246 | LLUUID key = new LLUUID(); | 4245 | LLUUID key = new LLUUID(); |
4247 | if (LLUUID.TryParse(id,out key)) | 4246 | if (LLUUID.TryParse(id,out key)) |
4248 | { | 4247 | { |
4249 | SceneObjectPart obj = new SceneObjectPart(); | 4248 | ScenePresence presence = World.GetScenePresence(key); |
4250 | obj = World.GetSceneObjectPart(World.Entities[key].LocalId); | 4249 | if (presence != null) // object is an avatar |
4251 | if (obj.OwnerID == World.GetLandOwner(obj.AbsolutePosition.X, obj.AbsolutePosition.Y)) | ||
4252 | { | 4250 | { |
4253 | return 1; | 4251 | if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) |
4252 | return 1; | ||
4254 | } | 4253 | } |
4255 | else | 4254 | else // object is not an avatar |
4256 | { | 4255 | { |
4257 | return 0; | 4256 | SceneObjectPart obj = World.GetSceneObjectPart(key); |
4257 | if (obj != null) | ||
4258 | if (m_host.OwnerID == World.GetLandOwner(obj.AbsolutePosition.X, obj.AbsolutePosition.Y)) | ||
4259 | return 1; | ||
4258 | } | 4260 | } |
4259 | } | 4261 | } |
4260 | else | 4262 | return 0; |
4261 | { | ||
4262 | return 0; | ||
4263 | } | ||
4264 | } | 4263 | } |
4265 | 4264 | ||
4266 | public string llGetLandOwnerAt(LSL_Types.Vector3 pos) | 4265 | public string llGetLandOwnerAt(LSL_Types.Vector3 pos) |