Add osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) variant.

This will be documented soon.  Options can currently be
  OS_NPC_CREATE_OWNED - creates a 'creator owned' avatar that will only respond to osNpc* functions made by scripts owned by the npc creator
  OS_NPC_NOT_OWNED    - creates an avatar which will respond to any osNpc* functions that a caller has permission to make (through the usual OSSL permission mechanisms).

options is being added to provide better scope for future extensibility without having to add more functions
The original non-options osNpcCreate() function will continue to exist.
This commit is contained in:
Justin Clark-Casey (justincc)
2012-01-12 19:37:30 +00:00
parent d27dd3714f
commit c4972e7734
4 changed files with 15 additions and 0 deletions

View File

@@ -2089,6 +2089,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return NpcCreate(firstname, lastname, position, notecard, false);
}
public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options)
{
CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
return NpcCreate(firstname, lastname, position, notecard, (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0);
}
private LSL_Key NpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, bool owned)
{
INPCModule module = World.RequestModuleInterface<INPCModule>();