diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 9 |
2 files changed, 17 insertions, 6 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 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 8356dce..3e0e452 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -447,9 +447,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
447 | 447 | ||
448 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence) | 448 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence) |
449 | { | 449 | { |
450 | if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc) | 450 | if ((ts.type & NPC) == 0 |
451 | && presence.PresenceType == PresenceType.Npc | ||
452 | && !npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent) | ||
451 | return; | 453 | return; |
452 | if ((ts.type & AGENT) == 0 && presence.PresenceType == PresenceType.User) | 454 | |
455 | if ((ts.type & AGENT) == 0 | ||
456 | && (presence.PresenceType == PresenceType.User | ||
457 | || npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent)) | ||
453 | return; | 458 | return; |
454 | 459 | ||
455 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) | 460 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) |