From 39018947081772bf7226d757c647520c54b18fd2 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Wed, 23 Apr 2008 01:04:01 +0000 Subject: QAR-488 Viewer 1.20 RC 2 merge Branch_1-20-Viewer -r 84760 : 85100 -> release --- indra/newview/llhudeffectpointat.cpp | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'indra/newview/llhudeffectpointat.cpp') diff --git a/indra/newview/llhudeffectpointat.cpp b/indra/newview/llhudeffectpointat.cpp index 2679ed5fbb..4c352bab72 100644 --- a/indra/newview/llhudeffectpointat.cpp +++ b/indra/newview/llhudeffectpointat.cpp @@ -232,7 +232,11 @@ BOOL LLHUDEffectPointAt::setPointAt(EPointAtType target_type, LLViewerObject *ob return FALSE; } - llassert(target_type < POINTAT_NUM_TARGETS); + if (target_type >= POINTAT_NUM_TARGETS) + { + llwarns << "Bad target_type " << (int)target_type << " - ignoring." << llendl; + return FALSE; + } // must be same or higher priority than existing effect if (POINTAT_PRIORITIES[target_type] < POINTAT_PRIORITIES[mTargetType]) @@ -379,17 +383,19 @@ void LLHUDEffectPointAt::update() } else { - calcTargetPosition(); - - ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->startMotion(ANIM_AGENT_EDITING); + if (calcTargetPosition()) + { + ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->startMotion(ANIM_AGENT_EDITING); + } } } } //----------------------------------------------------------------------------- // calcTargetPosition() +// returns whether we successfully calculated a finite target position. //----------------------------------------------------------------------------- -void LLHUDEffectPointAt::calcTargetPosition() +bool LLHUDEffectPointAt::calcTargetPosition() { LLViewerObject *targetObject = (LLViewerObject *)mTargetObject; LLVector3 local_offset; @@ -435,10 +441,15 @@ void LLHUDEffectPointAt::calcTargetPosition() mTargetPos -= mSourceObject->getRenderPosition(); + if (!mTargetPos.isFinite()) + return false; + if (mSourceObject->isAvatar()) { ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->setAnimationData("PointAtPoint", (void *)&mTargetPos); } + + return true; } const LLVector3d LLHUDEffectPointAt::getPointAtPosGlobal() -- cgit v1.2.3