summaryrefslogtreecommitdiff
path: root/indra/newview/llpolymorph.cpp
diff options
context:
space:
mode:
authorDebi King (Dessie) <dessie@lindenlab.com>2011-04-14 16:44:38 -0400
committerDebi King (Dessie) <dessie@lindenlab.com>2011-04-14 16:44:38 -0400
commit647a270ee22ab38044013c8098babc20b9287ec7 (patch)
tree4269dd86943d73151049f62743dcef43353e1397 /indra/newview/llpolymorph.cpp
parent9c2f2b884a16d180f83e76d3ed58c949c9692eaf (diff)
parentfa785d9cf4638233586ecd6566a7d78dad51bb35 (diff)
merged tip of viewer-pre-beta at changeset id 0630e977504a
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