From 69611ab325034639bd11c28ddd60bfce770ee449 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sun, 9 Feb 2020 18:05:09 -0600 Subject: [PATCH] exit if a fatal startup error is encountered while in headless mode (#1491) --- library/Core.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/Core.cpp b/library/Core.cpp index 380f37965..00a8879fc 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -1579,6 +1579,12 @@ void Core::fatal (std::string output) #else cout << "DFHack fatal error: " << out.str() << std::endl; #endif + + bool is_headless = bool(getenv("DFHACK_HEADLESS")); + if (is_headless) + { + exit('f'); + } } std::string Core::getHackPath()