aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs24
1 files changed, 23 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 84493b1..f3787a0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3406,9 +3406,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3406 } 3406 }
3407 3407
3408 ScenePresence presence = World.GetScenePresence(agentID); 3408 ScenePresence presence = World.GetScenePresence(agentID);
3409
3410 if (presence != null) 3409 if (presence != null)
3411 { 3410 {
3411 // If permissions are being requested from an NPC and were not implicitly granted above then
3412 // auto grant all reuqested permissions if the script is owned by the NPC or the NPCs owner
3413 INPCModule npcModule = World.RequestModuleInterface<INPCModule>();
3414 if (npcModule != null && npcModule.IsNPC(agentID, World))
3415 {
3416 if (agentID == m_host.ParentGroup.OwnerID || npcModule.GetOwner(agentID) == m_host.ParentGroup.OwnerID)
3417 {
3418 lock (m_host.TaskInventory)
3419 {
3420 m_host.TaskInventory[m_item.ItemID].PermsGranter = agentID;
3421 m_host.TaskInventory[m_item.ItemID].PermsMask = perm;
3422 }
3423
3424 m_ScriptEngine.PostScriptEvent(m_item.ItemID, new EventParams(
3425 "run_time_permissions", new Object[] {
3426 new LSL_Integer(perm) },
3427 new DetectParams[0]));
3428 }
3429 // it is an NPC, exit even if the permissions werent granted above, they are not going to answer
3430 // the question!
3431 return;
3432 }
3433
3412 string ownerName = resolveName(m_host.ParentGroup.RootPart.OwnerID); 3434 string ownerName = resolveName(m_host.ParentGroup.RootPart.OwnerID);
3413 if (ownerName == String.Empty) 3435 if (ownerName == String.Empty)
3414 ownerName = "(hippos)"; 3436 ownerName = "(hippos)";