summaryrefslogtreecommitdiff
path: root/indra/newview/llpolymorph.cpp
diff options
context:
space:
mode:
authorDave SIMmONs <simon@lindenlab.com>2011-04-15 15:57:57 -0700
committerDave SIMmONs <simon@lindenlab.com>2011-04-15 15:57:57 -0700
commitddd599b3473609788e430adf1895b12a5cb35375 (patch)
treec41da37ab77e25cfc76d85448c51103a7b55e2ca /indra/newview/llpolymorph.cpp
parentebe0c8204df30a85b8228e81acbcf7945c15220c (diff)
parent411a1bfcb6e6f7c0bc6e8afcf8aed447426df340 (diff)
Merge
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