From 5936e0c3760922e09099b65e3db522055db2286c Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 18 Apr 2012 19:51:27 +0200 Subject: Allow scripts in attachments owned by the NPC to control the NPC --- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 68f21c8..ebf5e84 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -323,9 +323,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC { NPCAvatar av; if (m_avatars.TryGetValue(npcID, out av)) + { + if (npcID == callerID) + return true; return CheckPermissions(av, callerID); + } else + { return false; + } } } @@ -337,7 +343,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC /// 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; + return callerID == UUID.Zero || av.OwnerID == UUID.Zero || av.OwnerID == callerID || av.AgentId == callerID; } } } -- cgit v1.1