diff options
author | Justin Clark-Casey (justincc) | 2011-08-18 00:53:05 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-18 00:53:05 +0100 |
commit | c1a34cd8da293e63d3cba70b5271c9a297789db2 (patch) | |
tree | f6d87f42151ca8891cb37ed1bf2a5d5361c86ddf /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | comment out noisy attachments logging (diff) | |
download | opensim-SC_OLD-c1a34cd8da293e63d3cba70b5271c9a297789db2.zip opensim-SC_OLD-c1a34cd8da293e63d3cba70b5271c9a297789db2.tar.gz opensim-SC_OLD-c1a34cd8da293e63d3cba70b5271c9a297789db2.tar.bz2 opensim-SC_OLD-c1a34cd8da293e63d3cba70b5271c9a297789db2.tar.xz |
Don't try to save changed attachment states when an NPC with attachments is removed from the scene.
This is done by introducing a PresenceType enum into ScenePresence which currently has two values, User and Npc.
This seems better than a SaveAttachments flag in terms of code comprehension, though I'm still slightly uneasy about introducing these semantics to core objects
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 13b4cbc..ae88a87 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2543,10 +2543,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2543 | #region Add/Remove Avatar Methods | 2543 | #region Add/Remove Avatar Methods |
2544 | 2544 | ||
2545 | /// <summary> | 2545 | /// <summary> |
2546 | /// Adding a New Client and Create a Presence for it. | 2546 | /// Add a new client and create a child agent for it. |
2547 | /// </summary> | 2547 | /// </summary> |
2548 | /// <param name="client"></param> | 2548 | /// <param name="client"></param> |
2549 | public override void AddNewClient(IClientAPI client) | 2549 | /// <param name="type">The type of agent to add.</param> |
2550 | public override void AddNewClient(IClientAPI client, PresenceType type) | ||
2550 | { | 2551 | { |
2551 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); | 2552 | AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); |
2552 | bool vialogin = false; | 2553 | bool vialogin = false; |
@@ -2566,7 +2567,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2566 | m_clientManager.Add(client); | 2567 | m_clientManager.Add(client); |
2567 | SubscribeToClientEvents(client); | 2568 | SubscribeToClientEvents(client); |
2568 | 2569 | ||
2569 | ScenePresence sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance); | 2570 | ScenePresence sp = m_sceneGraph.CreateAndAddChildScenePresence(client, aCircuit.Appearance, type); |
2570 | m_eventManager.TriggerOnNewPresence(sp); | 2571 | m_eventManager.TriggerOnNewPresence(sp); |
2571 | 2572 | ||
2572 | sp.TeleportFlags = (TeleportFlags)aCircuit.teleportFlags; | 2573 | sp.TeleportFlags = (TeleportFlags)aCircuit.teleportFlags; |
@@ -3149,7 +3150,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3149 | 3150 | ||
3150 | m_eventManager.TriggerOnRemovePresence(agentID); | 3151 | m_eventManager.TriggerOnRemovePresence(agentID); |
3151 | 3152 | ||
3152 | if (avatar != null && (!avatar.IsChildAgent)) | 3153 | if (avatar != null && (!avatar.IsChildAgent) && avatar.PresenceType != PresenceType.Npc) |
3153 | avatar.SaveChangedAttachments(); | 3154 | avatar.SaveChangedAttachments(); |
3154 | 3155 | ||
3155 | ForEachClient( | 3156 | ForEachClient( |