fix crash when double-clicking animation in a different state than active state

meow-7.2.2
chanayane 2025-01-30 00:08:03 +01:00
parent c5521b404a
commit 664f8178ac
No known key found for this signature in database
GPG Key ID: F60C8AE3A90228FA
3 changed files with 11 additions and 0 deletions

View File

@ -798,6 +798,12 @@ void FloaterAO::onDoubleClick()
return;
}
// do nothing if animation is for a different state than the active state
if (mSelectedState != AOEngine::instance().getCurrentState())
{
return;
}
// activate AO set if necessary
if (AOEngine::instance().getCurrentSet() != mSelectedSet)
{

View File

@ -1063,6 +1063,10 @@ const AOSet* AOEngine::getCurrentSet() const
{
return mCurrentSet;
}
const AOSet::AOState* AOEngine::getCurrentState() const
{
return mCurrentSet->getStateByRemapID(mLastMotion);
}
// </AS:Chanayane>
void AOEngine::updateSortOrder(AOSet::AOState* state)

View File

@ -126,6 +126,7 @@ class AOEngine
// <AS:Chanayane> Double click on animation in AO
void playAnimation(const LLUUID& animation);
const AOSet* getCurrentSet() const;
const AOSet::AOState* getCurrentState() const;
// </AS:Chanayane>
void inMouselook(bool mouselook);