From 251592e54a7ad0ec8e3a977ce399949d2fcfd6d9 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Wed, 5 Jan 2011 16:22:27 -0800 Subject: [PATCH] Code cleanup for better exception processing when looking for a scenePresence when routing a physics event --- .../PhysEngineToSceneConnectorModule.cs | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/PhysEngineToSceneConnectorModule.cs b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/PhysEngineToSceneConnectorModule.cs index 8a8a92c7d9..caa6277035 100644 --- a/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/PhysEngineToSceneConnectorModule.cs +++ b/OpenSim/Region/CoreModules/RegionSync/RegionSyncModule/PhysEngineToSceneConnectorModule.cs @@ -233,7 +233,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule /// public static void RouteUpdate(PhysicsActor pa) { - SceneObjectPart sop = null; + SceneObjectPart sop; + ScenePresence sp; Scene s = null; foreach (Scene ss in m_allScenes) { @@ -250,13 +251,18 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule s = ss; break; } + try { - ScenePresence sp = ss.GetScenePresence(pa.LocalID); - if (sp != null) - { - s = ss; - break; - } + sp = ss.GetScenePresence(pa.LocalID); + } + catch + { + sp = null; + } + if (sp != null) + { + s = ss; + break; } } if (s != null) @@ -447,7 +453,6 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule m_log.Warn(LogHeader + " Not currently synchronized"); return; } - m_log.Warn(LogHeader + " Synchronized"); foreach (KeyValuePair pair in m_PEToSceneConnectors) { PhysEngineToSceneConnector sceneConnector = pair.Value;