From e041f09750419f60c819ee7e7a99044fe43a811c Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Thu, 6 Sep 2012 11:45:52 +0100 Subject: refactoring to allow Scene.GetLandData to accept Vector3 as an argument. Note that the prior work on LSL_Vector implicit operators means one does not need to explicitly cast a LSL_Vector to Vector3 --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 18 +++++++++--------- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 83c9739..11826bd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -1959,8 +1959,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // this could possibly be done in the above else-if block, but we're doing the check here to keep the code easier to read. Vector3 objectPos = m_host.ParentGroup.RootPart.AbsolutePosition; - LandData here = World.GetLandData((float)objectPos.X, (float)objectPos.Y); - LandData there = World.GetLandData((float)pos.x, (float)pos.y); + LandData here = World.GetLandData(objectPos); + LandData there = World.GetLandData(pos); // we're only checking prim limits if it's moving to a different parcel under the assumption that if the object got onto the parcel without exceeding the prim limits. @@ -9770,20 +9770,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api switch ((ParcelMediaCommandEnum) aList.Data[i]) { case ParcelMediaCommandEnum.Url: - list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaURL)); + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition).MediaURL)); break; case ParcelMediaCommandEnum.Desc: - list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).Description)); + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition).Description)); break; case ParcelMediaCommandEnum.Texture: - list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaID.ToString())); + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition).MediaID.ToString())); break; case ParcelMediaCommandEnum.Type: - list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaType)); + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition).MediaType)); break; case ParcelMediaCommandEnum.Size: - list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaWidth)); - list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaHeight)); + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition).MediaWidth)); + list.Add(new LSL_String(World.GetLandData(m_host.AbsolutePosition).MediaHeight)); break; default: ParcelMediaCommandEnum mediaCommandEnum = ParcelMediaCommandEnum.Url; @@ -10398,7 +10398,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_List llGetParcelDetails(LSL_Vector pos, LSL_List param) { m_host.AddScriptLPS(1); - LandData land = World.GetLandData((float)pos.x, (float)pos.y); + LandData land = World.GetLandData(pos); if (land == null) { return new LSL_List(0); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 2e1e5b6..8b73cd9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2941,7 +2941,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api ScenePresence presence = World.GetScenePresence(avatarId); if (presence != null) { - LandData land = World.GetLandData((float)pos.X, (float)pos.Y); + LandData land = World.GetLandData(pos); if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage) { float health = presence.Health; -- cgit v1.1