MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Break

Method Break

src/script/api/script_controller.cpp:48–63  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

46}
47
48/* static */ void ScriptController::Break(const std::string &message)
49{
50 if (_network_dedicated || !_settings_client.gui.ai_developer_tools) return;
51
52 ScriptObject::GetActiveInstance().Pause();
53
54 ScriptLog::Log(ScriptLogTypes::LOG_SQ_ERROR, fmt::format("Break: {}", message));
55
56 /* Inform script developer that their script has been paused and
57 * needs manual action to continue. */
58 ShowScriptDebugWindow(ScriptObject::GetRootCompany());
59
60 if (!_pause_mode.Test(PauseMode::Normal)) {
61 ScriptObject::Command<CMD_PAUSE>::Do(PauseMode::Normal, true);
62 }
63}
64
65/* static */ void ScriptController::Print(bool error_msg, const std::string &message)
66{

Callers

nothing calls this directly

Calls 4

ShowScriptDebugWindowFunction · 0.85
TestMethod · 0.80
formatFunction · 0.50
PauseMethod · 0.45

Tested by

no test coverage detected