Add OS_NPC_SENSE_AS_AGENT option to osNpcCreate().

This allows NPCs to be sensed as agents by LSL sensors rather than as a specific NPC type (which is currently an OpenSimulator-only extension).
Wiki doc on this and other recent NPC functions will follow soon
This commit is contained in:
Justin Clark-Casey (justincc)
2012-01-28 00:00:12 +00:00
parent 31b87ff07b
commit 7837c611fb
7 changed files with 83 additions and 17 deletions

View File

@@ -109,9 +109,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC
}
public UUID CreateNPC(
string firstname, string lastname, Vector3 position, UUID owner, Scene scene, AvatarAppearance appearance)
string firstname,
string lastname,
Vector3 position,
UUID owner,
bool senseAsAgent,
Scene scene,
AvatarAppearance appearance)
{
NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, owner, scene);
NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, owner, senseAsAgent, scene);
npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue);
m_log.DebugFormat(
@@ -266,6 +272,17 @@ namespace OpenSim.Region.OptionalModules.World.NPC
return UUID.Zero;
}
public INPC GetNPC(UUID agentID, Scene scene)
{
lock (m_avatars)
{
if (m_avatars.ContainsKey(agentID))
return m_avatars[agentID];
else
return null;
}
}
public bool DeleteNPC(UUID agentID, Scene scene)
{
lock (m_avatars)