diff options
author | Justin Clark-Casey (justincc) | 2012-01-28 00:00:12 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-01-28 00:00:12 +0000 |
commit | 7837c611fb483dc776b531306d3d791e8f177aab (patch) | |
tree | 01c728a0f46a209eb0267bc166f70260748f4ca8 /OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |
parent | Increment LPS script stat for OSSL functions that were not already doing this (diff) | |
download | opensim-SC-7837c611fb483dc776b531306d3d791e8f177aab.zip opensim-SC-7837c611fb483dc776b531306d3d791e8f177aab.tar.gz opensim-SC-7837c611fb483dc776b531306d3d791e8f177aab.tar.bz2 opensim-SC-7837c611fb483dc776b531306d3d791e8f177aab.tar.xz |
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
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index d90309f..3831d7a 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -109,9 +109,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
109 | } | 109 | } |
110 | 110 | ||
111 | public UUID CreateNPC( | 111 | public UUID CreateNPC( |
112 | string firstname, string lastname, Vector3 position, UUID owner, Scene scene, AvatarAppearance appearance) | 112 | string firstname, |
113 | string lastname, | ||
114 | Vector3 position, | ||
115 | UUID owner, | ||
116 | bool senseAsAgent, | ||
117 | Scene scene, | ||
118 | AvatarAppearance appearance) | ||
113 | { | 119 | { |
114 | NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, owner, scene); | 120 | NPCAvatar npcAvatar = new NPCAvatar(firstname, lastname, position, owner, senseAsAgent, scene); |
115 | npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue); | 121 | npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, int.MaxValue); |
116 | 122 | ||
117 | m_log.DebugFormat( | 123 | m_log.DebugFormat( |
@@ -266,6 +272,17 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
266 | return UUID.Zero; | 272 | return UUID.Zero; |
267 | } | 273 | } |
268 | 274 | ||
275 | public INPC GetNPC(UUID agentID, Scene scene) | ||
276 | { | ||
277 | lock (m_avatars) | ||
278 | { | ||
279 | if (m_avatars.ContainsKey(agentID)) | ||
280 | return m_avatars[agentID]; | ||
281 | else | ||
282 | return null; | ||
283 | } | ||
284 | } | ||
285 | |||
269 | public bool DeleteNPC(UUID agentID, Scene scene) | 286 | public bool DeleteNPC(UUID agentID, Scene scene) |
270 | { | 287 | { |
271 | lock (m_avatars) | 288 | lock (m_avatars) |