diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-05 13:37:29 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-05 13:37:29 +0000 |
| commit | ff76fbe763ade84d97f3b50bc08276cdd0e7471e (patch) | |
| tree | 441f5a16a39cfdd92e336e79f146f2263ac855a2 /src/helpers/AnimatedVariable.cpp | |
| parent | cfbab453e88336c4714868f40eb3c8b159cfa783 (diff) | |
prevent double-registering of avars
Diffstat (limited to 'src/helpers/AnimatedVariable.cpp')
| -rw-r--r-- | src/helpers/AnimatedVariable.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/helpers/AnimatedVariable.cpp b/src/helpers/AnimatedVariable.cpp index c4a1713d..77707349 100644 --- a/src/helpers/AnimatedVariable.cpp +++ b/src/helpers/AnimatedVariable.cpp @@ -54,10 +54,13 @@ CAnimatedVariable::~CAnimatedVariable() { void CAnimatedVariable::unregister() { g_pAnimationManager->m_lAnimatedVariables.remove(this); + m_bIsRegistered = false; } void CAnimatedVariable::registerVar() { - g_pAnimationManager->m_lAnimatedVariables.push_back(this); + if (!m_bIsRegistered) + g_pAnimationManager->m_lAnimatedVariables.push_back(this); + m_bIsRegistered = true; } int CAnimatedVariable::getDurationLeftMs() { |
