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

@@ -447,9 +447,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence)
{
if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc)
if ((ts.type & NPC) == 0
&& presence.PresenceType == PresenceType.Npc
&& !npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent)
return;
if ((ts.type & AGENT) == 0 && presence.PresenceType == PresenceType.User)
if ((ts.type & AGENT) == 0
&& (presence.PresenceType == PresenceType.User
|| npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent))
return;
if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0)