diff options
Diffstat (limited to 'indra/llinventory/llsettingsbase.cpp')
-rw-r--r-- | indra/llinventory/llsettingsbase.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index daf42fc073..a6a7a9acf9 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -542,9 +542,7 @@ F64 LLSettingsBlender::setPosition(F64 blendf) { if (blendf >= 1.0) { - mTarget->replaceSettings(mFinal->getSettings()); - LLSettingsBlender::ptr_t hold = shared_from_this(); // prevents this from deleting too soon - mOnFinished(shared_from_this()); + triggerComplete(); return 1.0; } blendf = llclamp(blendf, 0.0, 1.0); @@ -556,11 +554,24 @@ F64 LLSettingsBlender::setPosition(F64 blendf) return blendf; } +void LLSettingsBlender::triggerComplete() +{ + mTarget->replaceSettings(mFinal->getSettings()); + LLSettingsBlender::ptr_t hold = shared_from_this(); // prevents this from deleting too soon + mOnFinished(shared_from_this()); +} + //------------------------------------------------------------------------- void LLSettingsBlenderTimeDelta::update(F64 timedelta) { mTimeSpent += F64Seconds(timedelta); + if (mTimeSpent > mBlendSpan) + { + triggerComplete(); + return; + } + F64 blendf = fmod(mTimeSpent.value(), mBlendSpan.value()) / mBlendSpan.value(); // Note no clamp here. |