From c906128191a6801df46d5542c441ef37c5c456a9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 16 Feb 2012 00:15:39 +0000 Subject: Fix some logic mistakes where firstly osNpcCreate() without options was creating npcs sensed as agents and secondly the OS_NPC_SENSE_AS_AGENT option was having the opposite effect. Hopefully makes progress on addressing http://opensimulator.org/mantis/view.php?id=5872 --- .../Shared/Api/Implementation/Plugins/SensorRepeat.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index 850f50b..5c1bdff 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs @@ -31,7 +31,6 @@ using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; using log4net; - using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.ScriptEngine.Shared; @@ -41,6 +40,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins { public class SensorRepeat { +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + public AsyncCommandManager m_CmdManager; public SensorRepeat(AsyncCommandManager CmdManager) @@ -447,11 +448,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins Action senseEntity = new Action(presence => { +// m_log.DebugFormat( +// "[SENSOR REPEAT]: Inspecting scene presence {0}, type {1} on sensor sweep for {2}, type {3}", +// presence.Name, presence.PresenceType, ts.name, ts.type); + if ((ts.type & NPC) == 0 && presence.PresenceType == PresenceType.Npc) { INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); if (npcData == null || !npcData.SenseAsAgent) + { +// m_log.DebugFormat( +// "[SENSOR REPEAT]: Discarding NPC {0} from agent sense sweep for script item id {1}", +// presence.Name, ts.itemID); return; + } } if ((ts.type & AGENT) == 0) @@ -464,7 +474,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins { INPC npcData = npcModule.GetNPC(presence.UUID, presence.Scene); if (npcData != null && npcData.SenseAsAgent) + { +// m_log.DebugFormat( +// "[SENSOR REPEAT]: Discarding NPC {0} from non-agent sense sweep for script item id {1}", +// presence.Name, ts.itemID); return; + } } } -- cgit v1.1