Fix broken continue button in cutscene if long loading time

This commit is contained in:
Benau 2022-08-15 09:44:12 +08:00
parent 8fead715da
commit 7aff7f9ba9
2 changed files with 10 additions and 6 deletions

View File

@ -252,6 +252,14 @@ void CutsceneWorld::update(int ticks)
m_time = now - m_time_at_second_reset;
}
if (m_aborted)
{
// We can only set end duration after m_time is updated in the previous
// step
if (m_time < m_duration - m_fade_duration)
m_duration = m_time + m_fade_duration;
}
float fade = 0.0f;
float fadeIn = -1.0f;
float fadeOut = -1.0f;

View File

@ -113,11 +113,7 @@ public:
// ------------------------------------------------------------------------
static void setUseDuration(bool use_duration) { s_use_duration = use_duration; }
// ------------------------------------------------------------------------
void abortCutscene()
{
if (m_time < m_duration - m_fade_duration) m_duration = m_time + m_fade_duration;
m_aborted = true;
}
void abortCutscene() { m_aborted = true; }
}; // CutsceneWorld