diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-04-23 01:04:01 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-04-23 01:04:01 +0000 |
commit | 39018947081772bf7226d757c647520c54b18fd2 (patch) | |
tree | 74b00b3006878d7e576b84cb3240d98c22d67db9 /indra/newview/llhudeffectpointat.cpp | |
parent | c01edec021194bacb86dc9a3f5a3cc655a8cb15f (diff) |
QAR-488 Viewer 1.20 RC 2
merge Branch_1-20-Viewer -r 84760 : 85100 -> release
Diffstat (limited to 'indra/newview/llhudeffectpointat.cpp')
-rw-r--r-- | indra/newview/llhudeffectpointat.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
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() |