aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-01-28 00:00:12 +0000
committerJustin Clark-Casey (justincc)2012-01-28 00:00:12 +0000
commit7837c611fb483dc776b531306d3d791e8f177aab (patch)
tree01c728a0f46a209eb0267bc166f70260748f4ca8 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
parentIncrement LPS script stat for OSSL functions that were not already doing this (diff)
downloadopensim-SC_OLD-7837c611fb483dc776b531306d3d791e8f177aab.zip
opensim-SC_OLD-7837c611fb483dc776b531306d3d791e8f177aab.tar.gz
opensim-SC_OLD-7837c611fb483dc776b531306d3d791e8f177aab.tar.bz2
opensim-SC_OLD-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/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs14
1 files changed, 10 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index a2f5c92..b1583eb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2233,7 +2233,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2233 CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); 2233 CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
2234 m_host.AddScriptLPS(1); 2234 m_host.AddScriptLPS(1);
2235 2235
2236 return NpcCreate(firstname, lastname, position, notecard, true); 2236 return NpcCreate(firstname, lastname, position, notecard, false, true);
2237 } 2237 }
2238 2238
2239 public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options) 2239 public LSL_Key osNpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, int options)
@@ -2241,10 +2241,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2241 CheckThreatLevel(ThreatLevel.High, "osNpcCreate"); 2241 CheckThreatLevel(ThreatLevel.High, "osNpcCreate");
2242 m_host.AddScriptLPS(1); 2242 m_host.AddScriptLPS(1);
2243 2243
2244 return NpcCreate(firstname, lastname, position, notecard, (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0); 2244 return NpcCreate(
2245 firstname, lastname, position, notecard,
2246 (options & ScriptBaseClass.OS_NPC_NOT_OWNED) == 0,
2247 (options & ScriptBaseClass.OS_NPC_SENSE_AS_AGENT) == 0);
2245 } 2248 }
2246 2249
2247 private LSL_Key NpcCreate(string firstname, string lastname, LSL_Vector position, string notecard, bool owned) 2250 private LSL_Key NpcCreate(
2251 string firstname, string lastname, LSL_Vector position, string notecard, bool owned, bool senseAsAgent)
2248 { 2252 {
2249 INPCModule module = World.RequestModuleInterface<INPCModule>(); 2253 INPCModule module = World.RequestModuleInterface<INPCModule>();
2250 if (module != null) 2254 if (module != null)
@@ -2281,7 +2285,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2281 lastname, 2285 lastname,
2282 new Vector3((float) position.x, (float) position.y, (float) position.z), 2286 new Vector3((float) position.x, (float) position.y, (float) position.z),
2283 ownerID, 2287 ownerID,
2284 World,appearance); 2288 senseAsAgent,
2289 World,
2290 appearance);
2285 2291
2286 return new LSL_Key(x.ToString()); 2292 return new LSL_Key(x.ToString());
2287 } 2293 }