From bee3f203cd93ed3816ff9d24ea04d4aa898cf779 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 4 Dec 2014 22:52:46 +0000
Subject: Allow scripts in attachments on an owned NPC to call NPC functions on
that NPC
---
OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/OptionalModules')
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 95e59ab..b834619 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -441,13 +441,20 @@ namespace OpenSim.Region.OptionalModules.World.NPC
///
/// Check if the caller has permission to manipulate the given NPC.
///
+ ///
+ /// A caller has permission if
+ /// * The caller UUID given is UUID.Zero.
+ /// * The avatar is unowned (owner is UUID.Zero).
+ /// * The avatar is owned and the owner and callerID match.
+ /// * The avatar is owned and the callerID matches its agentID.
+ ///
///
///
/// true if they do, false if they don't.
private bool CheckPermissions(NPCAvatar av, UUID callerID)
{
return callerID == UUID.Zero || av.OwnerID == UUID.Zero ||
- av.OwnerID == callerID;
+ av.OwnerID == callerID || av.AgentId == callerID;
}
}
}
\ No newline at end of file
--
cgit v1.1