diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2010-04-02 10:33:20 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2010-04-02 10:33:20 -0600 |
commit | 7bd603544e07b54acc2828e8b9763445d82b8c80 (patch) | |
tree | a8819ad35dcd74630fddfb8df51b98926bcfa01e /indra/newview | |
parent | 8dd401e4a12c4ec277b4474cea2ef0824f5c09b8 (diff) |
add some debug code for EXT-5394: Crash in LLViewerMediaImpl::calculateInterest()
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 2fcd3f1114..0f5a984188 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2701,7 +2701,13 @@ void LLViewerMediaImpl::calculateInterest() if(!mObjectList.empty()) { // Just use the first object in the list. We could go through the list and find the closest object, but this should work well enough. - LLVector3d global_delta = gAgent.getPositionGlobal() - (*mObjectList.begin())->getPositionGlobal(); + std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ; + LLVOVolume* objp = *iter ; + llassert_always(objp != NULL) ; + + LLVector3d obj_global = objp->getPositionGlobal() ; + LLVector3d agent_global = gAgent.getPositionGlobal() ; + LLVector3d global_delta = agent_global - obj_global ; mProximityDistance = global_delta.magVecSquared(); // use distance-squared because it's cheaper and sorts the same. } |