Take parent library into account for animator checking

This commit is contained in:
Benau 2019-12-14 00:21:47 +08:00
parent 1ee2f01fbc
commit b9af85442b
2 changed files with 11 additions and 1 deletions

View File

@ -755,7 +755,7 @@ bool TrackObject::joinToMainTrack()
{
// If no physical object or there is animator, skip it
// Also no joining if will affect kart (like moveable, flatten...)
if (!isEnabled() || !m_physical_object || m_animator ||
if (!isEnabled() || !m_physical_object || hasAnimatorRecursively() ||
m_physical_object->isDynamic() || m_physical_object->isCrashReset() ||
m_physical_object->isExplodeKartObject() ||
m_physical_object->isFlattenKartObject())

View File

@ -231,6 +231,16 @@ public:
// ------------------------------------------------------------------------
const ThreeDAnimation* getAnimator() const { return m_animator; }
// ------------------------------------------------------------------------
/* Return true if it has animator or its parent library has */
bool hasAnimatorRecursively() const
{
if (m_animator)
return true;
if (!m_parent_library)
return false;
return m_parent_library->hasAnimatorRecursively();
}
// ------------------------------------------------------------------------
void setPaused(bool mode){ m_animator->setPaused(mode); }
// ------------------------------------------------------------------------
void setInitiallyVisible(bool val) { m_initially_visible = val; }