From 0fb663272abe8e78b15a10359a91974db003662b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 14 May 2012 23:42:45 +0100 Subject: make llGetCameraPos and llGetCameraRot apply to avatar that granted permission and not owner --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6523c2d..10bddbd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -10525,7 +10525,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return new LSL_Vector(); m_host.TaskInventory.LockItemsForRead(true); - if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) + + UUID agentID = m_host.TaskInventory[invItemID].PermsGranter; + +// if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) + if (agentID == UUID.Zero) { m_host.TaskInventory.LockItemsForRead(false); return new LSL_Vector(); @@ -10539,7 +10543,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } m_host.TaskInventory.LockItemsForRead(false); - ScenePresence presence = World.GetScenePresence(m_host.OwnerID); +// ScenePresence presence = World.GetScenePresence(m_host.OwnerID); + ScenePresence presence = World.GetScenePresence(agentID); if (presence != null) { LSL_Vector pos = new LSL_Vector(presence.CameraPosition.X, presence.CameraPosition.Y, presence.CameraPosition.Z); @@ -10556,7 +10561,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return new LSL_Rotation(); m_host.TaskInventory.LockItemsForRead(true); - if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) + + UUID agentID = m_host.TaskInventory[invItemID].PermsGranter; + +// if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero) + if (agentID == UUID.Zero) { m_host.TaskInventory.LockItemsForRead(false); return new LSL_Rotation(); @@ -10569,7 +10578,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } m_host.TaskInventory.LockItemsForRead(false); - ScenePresence presence = World.GetScenePresence(m_host.OwnerID); +// ScenePresence presence = World.GetScenePresence(m_host.OwnerID); + ScenePresence presence = World.GetScenePresence(agentID); if (presence != null) { return new LSL_Rotation(presence.CameraRotation.X, presence.CameraRotation.Y, presence.CameraRotation.Z, presence.CameraRotation.W); -- cgit v1.1