Fixed a heisenbug where videos would sometimes not get rendered on application startup.

This commit is contained in:
Leon Styhre 2022-09-17 10:24:46 +02:00
parent 720a6fcc22
commit 3789a0ca12

View file

@ -272,6 +272,11 @@ std::vector<HelpPrompt> VideoComponent::getHelpPrompts()
void VideoComponent::update(int deltaTime) void VideoComponent::update(int deltaTime)
{ {
// A deltaTime value of 0 would lead to mFadeIn being an invalid number which would prevent
// the video from being rendered. This can happen on application startup in some instances.
if (deltaTime == 0)
deltaTime = 1;
if (!mHasVideo) { if (!mHasVideo) {
// We need this update so the static image gets updated (e.g. used for fade animations). // We need this update so the static image gets updated (e.g. used for fade animations).
GuiComponent::update(deltaTime); GuiComponent::update(deltaTime);