summaryrefslogtreecommitdiff
path: root/indra/llcharacter/llkeyframemotion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcharacter/llkeyframemotion.cpp')
-rw-r--r--indra/llcharacter/llkeyframemotion.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index bfa4b637e1..ea77126aca 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -1892,28 +1892,26 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
void* user_data, S32 status)
{
LLUUID* id = (LLUUID*)user_data;
+
+ std::vector<LLCharacter* >::iterator char_iter = LLCharacter::sInstances.begin();
- LLCharacter* character = NULL;
+ while(char_iter != LLCharacter::sInstances.end() &&
+ (*char_iter)->getID() != *id)
+ {
+ ++char_iter;
+ }
- for(character = LLCharacter::sInstances.getFirstData();
- character;
- character = LLCharacter::sInstances.getNextData())
- {
- if (character->getID() == *id)
- {
- break;
- }
- }
-
delete id;
- if (!character)
+ if (char_iter == LLCharacter::sInstances.end())
{
return;
}
+ LLCharacter* character = *char_iter;
+
// create an instance of this motion (it may or may not already exist)
- LLKeyframeMotion* motionp = (LLKeyframeMotion*)character->createMotion(asset_uuid);
+ LLKeyframeMotion* motionp = (LLKeyframeMotion*) character->createMotion(asset_uuid);
if (0 == status && motionp)
{