Skip video playback in HeadlessMode

play_movie() only early-outs for demo playback, but SVidPlayBegin
requires the SDL video subsystem that HeadlessMode intentionally never
initializes, so any real-time (non-demo) headless session crashes on
the first movie: the Lazarus in-game movie (gendata\fprst3.smk) and
the ending cinematics when Diablo dies. Mirror the existing
demo::IsRunning() early-out; the surrounding fade/redraw paths are
already headless-safe, and this one guard covers every callsite
(intro logos, Lazarus, victory/ending, credits loop).

No behavior change in graphical builds.
This commit is contained in:
Lawrence Caldwell
2026-07-16 05:13:29 +01:00
committed by Gleb Mazovetskiy
parent d56af8aaf2
commit a02893ca3f
+6
View File
@@ -21,6 +21,7 @@
#include "engine/demomode.h"
#include "engine/events.hpp"
#include "engine/sound.h"
#include "headless_mode.hpp"
#include "hwcursor.hpp"
#include "storm/storm_svid.h"
#include "utils/display.h"
@@ -38,6 +39,11 @@ void play_movie(const char *pszMovie, bool userCanClose)
if (demo::IsRunning())
return;
// Video playback requires the SDL video subsystem, which HeadlessMode
// intentionally does not initialize.
if (HeadlessMode)
return;
movie_playing = true;
sound_disable_music(true);