diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-08-06 04:53:26 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-08-06 04:53:26 +0400 |
commit | 583fa7d1eaa5e13eb9d86b0fd198b0af2b6b2023 (patch) | |
tree | 02d60b1775046365173004296e0d5acd1b5e662a /source/gameengine/Ketsji | |
parent | a423f55ca9eb03c27b94f87e655d8ebd71e34cb6 (diff) |
Fix for [#32054] "Animation break after resuming scene" reported by Andreas Esau (ndee). The action's timing was getting messed up which resulted in negative local frames, which were being counted as "done."
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/BL_Action.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp index fbeb34b70b4..a21c3965be9 100644 --- a/source/gameengine/Ketsji/BL_Action.cpp +++ b/source/gameengine/Ketsji/BL_Action.cpp @@ -206,7 +206,7 @@ bool BL_Action::Play(const char* name, } // Now that we have an action, we have something we can play - m_starttime = KX_GetActiveEngine()->GetFrameTime(); + m_starttime = -1.f; // We get the start time on our first update m_startframe = m_localtime = start; m_endframe = end; m_blendin = blendin; @@ -338,6 +338,11 @@ void BL_Action::Update(float curtime) curtime -= KX_KetsjiEngine::GetSuspendedDelta(); + // Grab the start time here so we don't end up with a negative m_localtime when + // suspending and resuming scenes. + if (m_starttime < 0) + m_starttime = curtime; + if (m_calc_localtime) SetLocalTime(curtime); else |