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

Function ShowScriptDebugWindowIfScriptError

src/script/script_gui.cpp:1304–1320  ·  view source on GitHub ↗

Open the AI debug window if one of the AI scripts has crashed. */

Source from the content-addressed store, hash-verified

1302
1303/** Open the AI debug window if one of the AI scripts has crashed. */
1304void ShowScriptDebugWindowIfScriptError()
1305{
1306 /* Network clients can't debug AIs. */
1307 if (_networking && !_network_server) return;
1308
1309 for (const Company *c : Company::Iterate()) {
1310 if (c->is_ai && c->ai_instance->IsDead()) {
1311 ShowScriptDebugWindow(c->index);
1312 break;
1313 }
1314 }
1315
1316 GameInstance *g = Game::GetInstance();
1317 if (g != nullptr && g->IsDead()) {
1318 ShowScriptDebugWindow(OWNER_DEITY);
1319 }
1320}

Callers 1

StartScriptsFunction · 0.85

Calls 2

ShowScriptDebugWindowFunction · 0.85
IsDeadMethod · 0.45

Tested by

no test coverage detected