summaryrefslogtreecommitdiff
path: root/indra/newview/llpolymorph.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-04-08 17:36:13 -0400
committerOz Linden <oz@lindenlab.com>2011-04-08 17:36:13 -0400
commit5dea0bb37c2c4e58cc5535f5c02fed6ad555f02a (patch)
tree5ff27055ef071fd080aa29ea1e60058da12742cf /indra/newview/llpolymorph.cpp
parent67aba3395d46a9b88f9d5dc758a27a7d8e542c16 (diff)
parent51b75b883269a0a78a9428a690324c17abf028c1 (diff)
merge changes for viewer-social-2
Diffstat (limited to 'indra/newview/llpolymorph.cpp')
-rw-r--r--indra/newview/llpolymorph.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/llpolymorph.cpp b/indra/newview/llpolymorph.cpp
index 5a67fd482a..36f8c8d13e 100644
--- a/indra/newview/llpolymorph.cpp
+++ b/indra/newview/llpolymorph.cpp
@@ -490,6 +490,16 @@ void LLPolyMorphTarget::apply( ESex avatar_sex )
mLastSex = avatar_sex;
+ // Check for NaN condition (NaN is detected if a variable doesn't equal itself.
+ if (mCurWeight != mCurWeight)
+ {
+ mCurWeight = 0.0;
+ }
+ if (mLastWeight != mLastWeight)
+ {
+ mLastWeight = mCurWeight+.001;
+ }
+
// perform differential update of morph
F32 delta_weight = ( getSex() & avatar_sex ) ? (mCurWeight - mLastWeight) : (getDefaultWeight() - mLastWeight);
// store last weight