From cc69d12d542cc7cea66e7b045b97c27c43d205bd Mon Sep 17 00:00:00 2001 From: Tom Date: Fri, 15 Jul 2011 11:12:10 -0700 Subject: [PATCH] Fix a raycast issue --- .../Physics/ChOdePlugin/ODERayCastRequestManager.cs | 13 +++++++++++-- .../Physics/OdePlugin/ODERayCastRequestManager.cs | 11 +++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/ChOdePlugin/ODERayCastRequestManager.cs index 7314107ad6..712029e0d1 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODERayCastRequestManager.cs @@ -109,8 +109,17 @@ namespace OpenSim.Region.Physics.OdePlugin ODERayCastRequest[] reqs = m_PendingRequests.ToArray(); for (int i = 0; i < reqs.Length; i++) { - if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast - RayCast(reqs[i]); // if there isn't anyone to send results + try + { + if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast + RayCast(reqs[i]); // if there isn't anyone to send results + } + catch + { + //Fail silently + //This can genuinely happen because raycast requests are queued, and the actor may have + //been removed from the scene since it was queued + } } /* foreach (ODERayCastRequest req in m_PendingRequests) diff --git a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs index ba77daebae..15ccddc1ef 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs @@ -109,8 +109,15 @@ namespace OpenSim.Region.Physics.OdePlugin ODERayCastRequest[] reqs = m_PendingRequests.ToArray(); for (int i = 0; i < reqs.Length; i++) { - if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast - RayCast(reqs[i]); // if there isn't anyone to send results + try + { + if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast + RayCast(reqs[i]); // if there isn't anyone to send results + } + catch + { + //Fail silently + } } /* foreach (ODERayCastRequest req in m_PendingRequests)