prevent double-registering of avars

This commit is contained in:
vaxerski 2022-11-05 13:37:29 +00:00
parent cfbab453e8
commit ff76fbe763
2 changed files with 5 additions and 1 deletions

View file

@ -54,10 +54,13 @@ CAnimatedVariable::~CAnimatedVariable() {
void CAnimatedVariable::unregister() { void CAnimatedVariable::unregister() {
g_pAnimationManager->m_lAnimatedVariables.remove(this); g_pAnimationManager->m_lAnimatedVariables.remove(this);
m_bIsRegistered = false;
} }
void CAnimatedVariable::registerVar() { void CAnimatedVariable::registerVar() {
if (!m_bIsRegistered)
g_pAnimationManager->m_lAnimatedVariables.push_back(this); g_pAnimationManager->m_lAnimatedVariables.push_back(this);
m_bIsRegistered = true;
} }
int CAnimatedVariable::getDurationLeftMs() { int CAnimatedVariable::getDurationLeftMs() {

View file

@ -200,6 +200,7 @@ private:
SAnimationPropertyConfig* m_pConfig = nullptr; SAnimationPropertyConfig* m_pConfig = nullptr;
bool m_bDummy = true; bool m_bDummy = true;
bool m_bIsRegistered = false;
std::chrono::system_clock::time_point animationBegin; std::chrono::system_clock::time_point animationBegin;