From dd694f0add587b8117c824a2bb4d6dc525c27304 Mon Sep 17 00:00:00 2001 From: Salad Dais Date: Thu, 9 Nov 2023 15:41:08 +0000 Subject: Fix BUG-225288: Detaching stops unrelated animations This is to do with misunderstandings related to how .find() works with multimaps. .find() will, in fact, return an iterator to the first iterator it finds, and will iterate through all elements in the multimap when incremented, not just items with the same key. Change code working with animation sources to be aware of this fact, so unrelated animation sources do not have their animations stopped. --- indra/newview/llviewermessage.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llviewermessage.cpp') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f3288a5300..7b91e4806f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -4152,6 +4152,12 @@ void process_avatar_animation(LLMessageSystem *mesgsys, void **user_data) LLVOAvatar::AnimSourceIterator anim_it = avatarp->mAnimationSources.find(object_id); for (;anim_it != avatarp->mAnimationSources.end(); ++anim_it) { + if (anim_it->first != object_id) + { + // elements with the same key are always contiguous, bail if we went past the + // end of this object's animations + break; + } if (anim_it->second == animation_id) { anim_found = TRUE; -- cgit v1.2.3