diff options
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 2a0ce44..5c200d6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -450,17 +450,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
450 | Vector3 toRegionPos; | 450 | Vector3 toRegionPos; |
451 | double dis; | 451 | double dis; |
452 | 452 | ||
453 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence) | 453 | Action<ScenePresence> senseEntity = new Action<ScenePresence>(presence => |
454 | { | 454 | { |
455 | if ((ts.type & NPC) == 0 | 455 | if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc) |
456 | && presence.PresenceType == PresenceType.Npc | 456 | { |
457 | && !npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent) | 457 | INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); |
458 | return; | 458 | if (npcData == null || !npcData.SenseAsAgent) |
459 | return; | ||
460 | } | ||
459 | 461 | ||
460 | if ((ts.type & AGENT) == 0 | 462 | if ((ts.type & AGENT) == 0) |
461 | && (presence.PresenceType == PresenceType.User | 463 | { |
462 | || npcModule.GetNPC(presence.UUID, presence.Scene).SenseAsAgent)) | 464 | if (presence.PresenceType == PresenceType.User) |
463 | return; | 465 | { |
466 | return; | ||
467 | } | ||
468 | else | ||
469 | { | ||
470 | INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); | ||
471 | if (npcData != null && npcData.SenseAsAgent) | ||
472 | return; | ||
473 | } | ||
474 | } | ||
464 | 475 | ||
465 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) | 476 | if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0) |
466 | return; | 477 | return; |