* refactor: Remove GetLandOwner function from Scene

* Simplify since the land is never null
This commit is contained in:
Justin Clarke Casey
2009-03-06 20:44:31 +00:00
parent 85774de231
commit f12619b786
3 changed files with 35 additions and 43 deletions

View File

@@ -503,12 +503,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (presence != null)
{
// agent must be over owners land to avoid abuse
if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y))
if (m_host.OwnerID
== World.LandChannel.GetLandObject(
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID)
{
presence.ControllingClient.SendTeleportLocationStart();
World.RequestTeleportLocation(presence.ControllingClient, regionName,
new Vector3((float)position.x, (float)position.y, (float)position.z),
new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation);
ScriptSleep(5000);
}
}
@@ -532,7 +535,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (presence != null)
{
// agent must be over owners land to avoid abuse
if (m_host.OwnerID == World.GetLandOwner(presence.AbsolutePosition.X, presence.AbsolutePosition.Y))
if (m_host.OwnerID
== World.LandChannel.GetLandObject(
presence.AbsolutePosition.X, presence.AbsolutePosition.Y).landData.OwnerID)
{
presence.ControllingClient.SendTeleportLocationStart();
World.RequestTeleportLocation(presence.ControllingClient, regionHandle,
@@ -777,19 +782,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.VeryLow, "osSetParcelMediaURL");
m_host.AddScriptLPS(1);
UUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
ILandObject land
= World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
if (landowner == UUID.Zero)
{
if (land.landData.OwnerID != m_host.ObjectOwner)
return;
}
if (landowner != m_host.ObjectOwner)
{
return;
}
World.LandChannel.GetLandObject(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).SetMediaUrl(url);
land.SetMediaUrl(url);
}
public string osGetScriptEngineName()