X Tutup
Skip to content

Commit c2305f3

Browse files
KoloInDaCribEliteMasterEric
authored andcommitted
this bug seems kinda old why has nobody reported it before
1 parent 747446e commit c2305f3

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

source/funkin/play/PlayState.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3534,6 +3534,8 @@ class PlayState extends MusicBeatSubState
35343534

35353535
forEachPausedSound((s) -> s.destroy());
35363536

3537+
if (VideoCutscene.isPlaying()) VideoCutscene.destroyVideo();
3538+
35373539
FlxTween.globalManager.clear();
35383540
FlxTimer.globalManager.clear();
35393541

source/funkin/play/cutscene/VideoCutscene.hx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,38 @@ class VideoCutscene
347347
// throw "Not implemented!";
348348
}
349349
}
350+
351+
/**
352+
* Destroy the active cutscene, if any. Separate from finishVideo() so that it doesn't trigger onCutsceneFinish().
353+
*/
354+
public static function destroyVideo()
355+
{
356+
#if html5
357+
if (vid != null) PlayState.instance.remove(vid);
358+
#end
359+
360+
#if hxvlc
361+
if (vid != null)
362+
{
363+
vid.stop();
364+
PlayState.instance.remove(vid);
365+
}
366+
#end
367+
368+
#if (html5 || hxvlc)
369+
if (vid != null)
370+
{
371+
vid?.destroy();
372+
vid = null;
373+
}
374+
#end
375+
376+
if (blackScreen != null)
377+
{
378+
PlayState.instance.remove(blackScreen);
379+
blackScreen = null;
380+
}
381+
}
350382
}
351383

352384
enum CutsceneType

0 commit comments

Comments
 (0)
X Tutup