diff --git a/wadsrc/static/zscript/games/duke/ui/cutscenes.zs b/wadsrc/static/zscript/games/duke/ui/cutscenes.zs index 38dcdd375..6909a46ac 100644 --- a/wadsrc/static/zscript/games/duke/ui/cutscenes.zs +++ b/wadsrc/static/zscript/games/duke/ui/cutscenes.zs @@ -188,13 +188,15 @@ class DukeCutscenes // Note: must be class, not struct, otherwise we cannot easi 7, DukeSnd.INTRO4_3 + 1, 12, DukeSnd.INTRO4_2 + 1, 26, DukeSnd.INTRO4_4 + 1); - runner.Append(MoviePlayerJob.CreateWithSoundinfo("vol42a.anm", soundinfo, MoviePlayer.NOSOUNDCUTOFF, 14, 14, 14)); + let m = MoviePlayerJob.CreateWithSoundinfo("vol42a.anm", soundinfo, MoviePlayer.NOSOUNDCUTOFF, 14, 14, 14); + if (m) m.skipover = true; + runner.Append(m); soundinfo.Pushv( 10, DukeSnd.INTRO4_6 + 1); - runner.Append(MoviePlayerJob.CreateWithSoundinfo("vol43a.anm", soundinfo, 0, 10, 10, 10)); - - runner.skipall = true; + m = MoviePlayerJob.CreateWithSoundinfo("vol43a.anm", soundinfo, 0, 10, 10, 10); + if (m) m.skipover = true; + runner.Append(m); } //--------------------------------------------------------------------------- diff --git a/wadsrc/static/zscript/screenjob.zs b/wadsrc/static/zscript/screenjob.zs index 53c6d8a94..dd7763cd9 100644 --- a/wadsrc/static/zscript/screenjob.zs +++ b/wadsrc/static/zscript/screenjob.zs @@ -8,6 +8,8 @@ class ScreenJob : Object int ticks; int jobstate; + bool skipover; + enum EJobState { running = 0, // normal operation @@ -395,9 +397,9 @@ class ScreenJobRunner : Object if (index >= 0) jobs[index].Destroy(); index++; - while (index < jobs.Size() && (jobs[index] == null || (skip && skipall))) + while (index < jobs.Size() && (jobs[index] == null || (skip && jobs[index].skipover))) { - if (jobs[index] != null) jobs[index].Destroy(); + if (jobs[index] != null && index < jobs.Size() - 1) jobs[index].Destroy(); // may not delete the last element - we still need it for shutting down. index++; } actionState = clearbefore ? State_Clear : State_Run;