diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs index bf55e7b..d036dbb 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Inventory/InventoryModule.cs | |||
@@ -233,13 +233,49 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Inventory | |||
233 | public bool NeedSceneCacheClear(LLUUID agentID, Scene scene) | 233 | public bool NeedSceneCacheClear(LLUUID agentID, Scene scene) |
234 | { | 234 | { |
235 | if (!m_AgentRegions.ContainsKey(agentID)) | 235 | if (!m_AgentRegions.ContainsKey(agentID)) |
236 | { | ||
237 | // Since we can get here two ways, we need to scan | ||
238 | // the scenes here. This is somewhat more expensive | ||
239 | // but helps avoid a nasty bug | ||
240 | // | ||
241 | |||
242 | foreach (Scene s in m_Scenelist) | ||
243 | { | ||
244 | ScenePresence presence; | ||
245 | |||
246 | if (s.TryGetAvatar(agentID, out presence)) | ||
247 | { | ||
248 | // If the agent is in this scene, then we | ||
249 | // are being called twice in a single | ||
250 | // teleport. This is wasteful of cycles | ||
251 | // but harmless due to this 2nd level check | ||
252 | // | ||
253 | // If the agent is found in another scene | ||
254 | // then the list wasn't current | ||
255 | // | ||
256 | // If the agent is totally unknown, then what | ||
257 | // are we even doing here?? | ||
258 | // | ||
259 | if (s == scene) | ||
260 | return true; | ||
261 | else | ||
262 | return false; | ||
263 | } | ||
264 | } | ||
236 | return true; | 265 | return true; |
266 | } | ||
237 | 267 | ||
268 | // The agent is left in current Scene, so we must be | ||
269 | // going to another instance | ||
270 | // | ||
238 | if (m_AgentRegions[agentID] == scene) | 271 | if (m_AgentRegions[agentID] == scene) |
239 | { | 272 | { |
240 | m_AgentRegions.Remove(agentID); | 273 | m_AgentRegions.Remove(agentID); |
241 | return true; | 274 | return true; |
242 | } | 275 | } |
276 | |||
277 | // Another region has claimed the agent | ||
278 | // | ||
243 | return false; | 279 | return false; |
244 | } | 280 | } |
245 | 281 | ||