aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llcharacter/llkeyframemotion.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llcharacter/llkeyframemotion.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/linden/indra/llcharacter/llkeyframemotion.cpp b/linden/indra/llcharacter/llkeyframemotion.cpp
index e5b0d99..d09de0e 100644
--- a/linden/indra/llcharacter/llkeyframemotion.cpp
+++ b/linden/indra/llcharacter/llkeyframemotion.cpp
@@ -1720,9 +1720,9 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
1720 { 1720 {
1721 success &= dp.packU8(shared_constraintp->mChainLength, "chain_length"); 1721 success &= dp.packU8(shared_constraintp->mChainLength, "chain_length");
1722 success &= dp.packU8(shared_constraintp->mConstraintType, "constraint_type"); 1722 success &= dp.packU8(shared_constraintp->mConstraintType, "constraint_type");
1723 char volume_name[16]; 1723 char volume_name[16]; /* Flawfinder: ignore */
1724 snprintf(volume_name, sizeof(volume_name), "%s", 1724 snprintf(volume_name, sizeof(volume_name), "%s", /* Flawfinder: ignore */
1725 mCharacter->findCollisionVolume(shared_constraintp->mSourceConstraintVolume)->getName().c_str()); /* Flawfinder: ignore */ 1725 mCharacter->findCollisionVolume(shared_constraintp->mSourceConstraintVolume)->getName().c_str());
1726 success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "source_volume"); 1726 success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "source_volume");
1727 success &= dp.packVector3(shared_constraintp->mSourceConstraintOffset, "source_offset"); 1727 success &= dp.packVector3(shared_constraintp->mSourceConstraintOffset, "source_offset");
1728 if (shared_constraintp->mConstraintTargetType == TYPE_GROUND) 1728 if (shared_constraintp->mConstraintTargetType == TYPE_GROUND)
@@ -1731,8 +1731,8 @@ BOOL LLKeyframeMotion::serialize(LLDataPacker& dp) const
1731 } 1731 }
1732 else 1732 else
1733 { 1733 {
1734 snprintf(volume_name, sizeof(volume_name),"%s", 1734 snprintf(volume_name, sizeof(volume_name),"%s", /* Flawfinder: ignore */
1735 mCharacter->findCollisionVolume(shared_constraintp->mTargetConstraintVolume)->getName().c_str()); /* Flawfinder: ignore */ 1735 mCharacter->findCollisionVolume(shared_constraintp->mTargetConstraintVolume)->getName().c_str());
1736 } 1736 }
1737 success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "target_volume"); 1737 success &= dp.packBinaryDataFixed((U8*)volume_name, 16, "target_volume");
1738 success &= dp.packVector3(shared_constraintp->mTargetConstraintOffset, "target_offset"); 1738 success &= dp.packVector3(shared_constraintp->mTargetConstraintOffset, "target_offset");
@@ -1911,28 +1911,26 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
1911 void* user_data, S32 status) 1911 void* user_data, S32 status)
1912{ 1912{
1913 LLUUID* id = (LLUUID*)user_data; 1913 LLUUID* id = (LLUUID*)user_data;
1914
1915 std::vector<LLCharacter* >::iterator char_iter = LLCharacter::sInstances.begin();
1914 1916
1915 LLCharacter* character = NULL; 1917 while(char_iter != LLCharacter::sInstances.end() &&
1918 (*char_iter)->getID() != *id)
1919 {
1920 ++char_iter;
1921 }
1916 1922
1917 for(character = LLCharacter::sInstances.getFirstData();
1918 character;
1919 character = LLCharacter::sInstances.getNextData())
1920 {
1921 if (character->getID() == *id)
1922 {
1923 break;
1924 }
1925 }
1926
1927 delete id; 1923 delete id;
1928 1924
1929 if (!character) 1925 if (char_iter == LLCharacter::sInstances.end())
1930 { 1926 {
1931 return; 1927 return;
1932 } 1928 }
1933 1929
1930 LLCharacter* character = *char_iter;
1931
1934 // create an instance of this motion (it may or may not already exist) 1932 // create an instance of this motion (it may or may not already exist)
1935 LLKeyframeMotion* motionp = (LLKeyframeMotion*)character->createMotion(asset_uuid); 1933 LLKeyframeMotion* motionp = (LLKeyframeMotion*) character->createMotion(asset_uuid);
1936 1934
1937 if (0 == status && motionp) 1935 if (0 == status && motionp)
1938 { 1936 {