Allow scripts in attachments owned by the NPC to control the NPC

avinationmerge
Melanie 2012-04-18 19:51:27 +02:00
parent 0fe0b2ceec
commit 5936e0c376
1 changed files with 7 additions and 1 deletions

View File

@ -323,9 +323,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC
{ {
NPCAvatar av; NPCAvatar av;
if (m_avatars.TryGetValue(npcID, out av)) if (m_avatars.TryGetValue(npcID, out av))
{
if (npcID == callerID)
return true;
return CheckPermissions(av, callerID); return CheckPermissions(av, callerID);
}
else else
{
return false; return false;
}
} }
} }
@ -337,7 +343,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
/// <returns>true if they do, false if they don't.</returns> /// <returns>true if they do, false if they don't.</returns>
private bool CheckPermissions(NPCAvatar av, UUID callerID) 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;
} }
} }
} }