mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user