summaryrefslogtreecommitdiff
path: root/indra/newview/llviewermedia.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-07 12:16:36 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-07 12:16:36 +0100
commit8da371b0f08f92fb1fef083f0bfb526f0698afd7 (patch)
treeb2ca851a0ef32e0994fb151a5457e615b4ea69c2 /indra/newview/llviewermedia.cpp
parent1e7ae7a69398a1bca88812545da7bc86db9f3c38 (diff)
parent244de628f2a71ea773cdcabb8328df26f20e3120 (diff)
merge
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r--indra/newview/llviewermedia.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index e0cbddafae..170eb7ae86 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2968,7 +2968,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.
}