refactor: Move existing npc owner checks to NPCModule.CheckPermissions() methods and expose on interface for external calls.

This commit is contained in:
Justin Clark-Casey (justincc)
2012-01-12 18:14:19 +00:00
parent 38db874755
commit b47c0d7e51
3 changed files with 45 additions and 18 deletions

View File

@@ -2152,11 +2152,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (!UUID.TryParse(npc.m_string, out npcId))
return new LSL_Key(UUID.Zero.ToString());
if (!npcModule.IsNPC(npcId, m_host.ParentGroup.Scene))
return new LSL_Key(UUID.Zero.ToString());
UUID ownerID = npcModule.GetOwner(npcId);
if (ownerID != UUID.Zero && ownerID != m_host.OwnerID)
if (!npcModule.CheckPermissions(npcId, m_host.OwnerID))
return new LSL_Key(UUID.Zero.ToString());
return SaveAppearanceToNotecard(npcId, notecard);