diff options
author | Justin Clarke Casey | 2009-03-06 20:44:31 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2009-03-06 20:44:31 +0000 |
commit | f12619b78665a6f6b148c870d36b528428cf78b4 (patch) | |
tree | a34dd0b82497fa347cdbe10ee2237dccd6fd5230 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |
parent | * Improve memory usage when writing OARs (diff) | |
download | opensim-SC_OLD-f12619b78665a6f6b148c870d36b528428cf78b4.zip opensim-SC_OLD-f12619b78665a6f6b148c870d36b528428cf78b4.tar.gz opensim-SC_OLD-f12619b78665a6f6b148c870d36b528428cf78b4.tar.bz2 opensim-SC_OLD-f12619b78665a6f6b148c870d36b528428cf78b4.tar.xz |
* refactor: Remove GetLandOwner function from Scene
* Simplify since the land is never null
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fad456f..517453e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -3706,8 +3706,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3706 | ScenePresence presence = World.GetScenePresence(agentId); | 3706 | ScenePresence presence = World.GetScenePresence(agentId); |
3707 | if (presence != null) | 3707 | if (presence != null) |
3708 | { | 3708 | { |
3709 | // agent must be over the owners land | 3709 | // agent must be over the owners land |
3710 | if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) | 3710 | if (m_host.OwnerID |
3711 | == World.LandChannel.GetLandObject( | ||
3712 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) | ||
3711 | { | 3713 | { |
3712 | presence.ControllingClient.SendTeleportLocationStart(); | 3714 | presence.ControllingClient.SendTeleportLocationStart(); |
3713 | World.TeleportClientHome(agentId, presence.ControllingClient); | 3715 | World.TeleportClientHome(agentId, presence.ControllingClient); |
@@ -5182,7 +5184,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5182 | if (presence != null) | 5184 | if (presence != null) |
5183 | { | 5185 | { |
5184 | // agent must be over the owners land | 5186 | // agent must be over the owners land |
5185 | if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) | 5187 | if (m_host.OwnerID |
5188 | == World.LandChannel.GetLandObject( | ||
5189 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) | ||
5186 | World.TeleportClientHome(agentId, presence.ControllingClient); | 5190 | World.TeleportClientHome(agentId, presence.ControllingClient); |
5187 | } | 5191 | } |
5188 | } | 5192 | } |
@@ -5265,29 +5269,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5265 | { | 5269 | { |
5266 | m_host.AddScriptLPS(1); | 5270 | m_host.AddScriptLPS(1); |
5267 | UUID key = new UUID(); | 5271 | UUID key = new UUID(); |
5268 | if (UUID.TryParse(id,out key)) | 5272 | if (UUID.TryParse(id, out key)) |
5269 | { | 5273 | { |
5270 | ScenePresence presence = World.GetScenePresence(key); | 5274 | ScenePresence presence = World.GetScenePresence(key); |
5271 | if (presence != null) // object is an avatar | 5275 | if (presence != null) // object is an avatar |
5272 | { | 5276 | { |
5273 | if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y)) | 5277 | if (m_host.OwnerID |
5278 | == World.LandChannel.GetLandObject( | ||
5279 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID) | ||
5274 | return 1; | 5280 | return 1; |
5275 | } | 5281 | } |
5276 | else // object is not an avatar | 5282 | else // object is not an avatar |
5277 | { | 5283 | { |
5278 | SceneObjectPart obj = World.GetSceneObjectPart(key); | 5284 | SceneObjectPart obj = World.GetSceneObjectPart(key); |
5279 | if (obj != null) | 5285 | if (obj != null) |
5280 | if (m_host.OwnerID == World.GetLandOwner(obj.AbsolutePosition.X, obj.AbsolutePosition.Y)) | 5286 | if (m_host.OwnerID |
5287 | == World.LandChannel.GetLandObject( | ||
5288 | obj.AbsolutePosition.X, obj.AbsolutePosition.Y).landData.OwnerID) | ||
5281 | return 1; | 5289 | return 1; |
5282 | } | 5290 | } |
5283 | } | 5291 | } |
5292 | |||
5284 | return 0; | 5293 | return 0; |
5285 | } | 5294 | } |
5286 | 5295 | ||
5287 | public LSL_String llGetLandOwnerAt(LSL_Vector pos) | 5296 | public LSL_String llGetLandOwnerAt(LSL_Vector pos) |
5288 | { | 5297 | { |
5289 | m_host.AddScriptLPS(1); | 5298 | m_host.AddScriptLPS(1); |
5290 | return World.GetLandOwner((float)pos.x, (float)pos.y).ToString(); | 5299 | return World.LandChannel.GetLandObject((float)pos.x, (float)pos.y).landData.OwnerID.ToString(); |
5291 | } | 5300 | } |
5292 | 5301 | ||
5293 | /// <summary> | 5302 | /// <summary> |
@@ -6812,17 +6821,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6812 | public void llSetParcelMusicURL(string url) | 6821 | public void llSetParcelMusicURL(string url) |
6813 | { | 6822 | { |
6814 | m_host.AddScriptLPS(1); | 6823 | m_host.AddScriptLPS(1); |
6815 | UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); | 6824 | |
6816 | if (landowner == UUID.Zero) | 6825 | ILandObject land = World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); |
6817 | { | 6826 | |
6818 | return; | 6827 | if (land.landData.OwnerID != m_host.ObjectOwner) |
6819 | } | ||
6820 | if (landowner != m_host.ObjectOwner) | ||
6821 | { | ||
6822 | return; | 6828 | return; |
6823 | } | ||
6824 | 6829 | ||
6825 | World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).SetMusicUrl(url); | 6830 | land.SetMusicUrl(url); |
6826 | 6831 | ||
6827 | // ScriptSleep(2000); | 6832 | // ScriptSleep(2000); |
6828 | } | 6833 | } |