summaryrefslogtreecommitdiff
path: root/indra/llprimitive/llmodel.cpp
diff options
context:
space:
mode:
authorAnsariel <ansariel.hiller@phoenixviewer.com>2024-04-11 21:59:38 +0200
committerAnsariel <ansariel.hiller@phoenixviewer.com>2024-04-11 21:59:38 +0200
commitd0102af56d3b1d5b1d9bf3c8eb9aeea77028b70e (patch)
treee31cee85f651a874c4b6edc7491efa0cb2ec93d5 /indra/llprimitive/llmodel.cpp
parent17e1f3692c5c1e9cbc6ba6895b312a8baae9aec2 (diff)
parentda9a1dcb55548a249ff7a1255f3e518696b81245 (diff)
Merge branch 'main' of https://github.com/secondlife/viewer into DRTVWR-600-maint-A
# Conflicts: # indra/llcommon/llapp.cpp # indra/llcommon/llapp.h # indra/llimage/llimageworker.cpp # indra/llui/llcontainerview.cpp # indra/llui/llcontainerview.h # indra/llui/llkeywords.cpp # indra/llui/lltabcontainer.cpp # indra/llui/lltextbase.cpp # indra/newview/llappviewer.cpp # indra/newview/llfavoritesbar.cpp # indra/newview/llfavoritesbar.h # indra/newview/llfloaterimnearbychathandler.cpp # indra/newview/llfloaterpreference.cpp # indra/newview/llhudnametag.h # indra/newview/llinventorypanel.cpp # indra/newview/llinventorypanel.h # indra/newview/llmeshrepository.cpp # indra/newview/lloutfitgallery.cpp # indra/newview/lloutfitslist.cpp # indra/newview/llpaneleditwearable.cpp # indra/newview/llpanelprofilepicks.cpp # indra/newview/llpanelvoicedevicesettings.h # indra/newview/llpreviewscript.cpp # indra/newview/llpreviewscript.h # indra/newview/llselectmgr.cpp # indra/newview/lltranslate.cpp # indra/newview/llviewerassetupload.cpp # indra/newview/llviewermessage.cpp
Diffstat (limited to 'indra/llprimitive/llmodel.cpp')
-rw-r--r--indra/llprimitive/llmodel.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp
index ee6387608e..d7c17be779 100644
--- a/indra/llprimitive/llmodel.cpp
+++ b/indra/llprimitive/llmodel.cpp
@@ -1041,7 +1041,12 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
weight_map::iterator iterPos = mSkinWeights.begin();
weight_map::iterator iterEnd = mSkinWeights.end();
- llassert(!mSkinWeights.empty());
+ if (mSkinWeights.empty())
+ {
+ // function calls iter->second on all return paths
+ // everything that calls this function should precheck that there is data.
+ LL_ERRS() << "called getJointInfluences with empty weights list" << LL_ENDL;
+ }
for ( ; iterPos!=iterEnd; ++iterPos )
{
@@ -1068,11 +1073,16 @@ LLModel::weight_list& LLModel::getJointInfluences(const LLVector3& pos)
const F32 epsilon = 1e-5f;
weight_map::iterator iter_up = mSkinWeights.lower_bound(pos);
weight_map::iterator iter_down = iter_up;
- if (iter_up != mSkinWeights.end())
- {
- iter_down = ++iter_up;
- }
- weight_map::iterator best = iter_up;
+ weight_map::iterator best = iter_up;
+ if (iter_up != mSkinWeights.end())
+ {
+ iter_down = ++iter_up;
+ }
+ else
+ {
+ // Assumes that there is at least one element
+ --best;
+ }
F32 min_dist = (iter->first - pos).magVec();