diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-12-09 16:05:59 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2015-12-09 16:05:59 -0500 |
commit | f7eaa4cc5e9b24e781c048a8ee5f8eef3216de15 (patch) | |
tree | 440724950b2b6485c46c5273abc5fcc4333c46ee /indra | |
parent | 02d286efee2708a68988116de3b4f69848f7cc91 (diff) | |
parent | ada91584f63b1c0d030045aaaae6b1e63b0a00d1 (diff) |
merge
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llcharacter/llbvhloader.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index d08788e2d1..9b18f648b2 100755 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -672,12 +672,19 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 & //--------------------------------------------------------------- // we require the root joint be "hip" - DEV-26188 //--------------------------------------------------------------- - const char* FORCED_ROOT_NAME = "hip"; - if ( (mJoints.size() == 0 ) && ( !strstr(jointName, FORCED_ROOT_NAME) ) ) - { - strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */ - return E_ST_BAD_ROOT; - } + if (mJoints.size() == 0 ) + { + //The root joint of the BVH file must be hip (mPelvis) or an alias of mPelvis. + const char* FORCED_ROOT_NAME = "hip"; + + TranslationMap::iterator hip_joint = mTranslations.find( FORCED_ROOT_NAME ); + TranslationMap::iterator root_joint = mTranslations.find( jointName ); + if ( hip_joint == mTranslations.end() || root_joint == mTranslations.end() || root_joint->second.mOutName != hip_joint->second.mOutName ) + { + strncpy(error_text, line.c_str(), 127); /* Flawfinder: ignore */ + return E_ST_BAD_ROOT; + } + } //---------------------------------------------------------------- |