Open the AI debug window if one of the AI scripts has crashed. */
| 1302 | |
| 1303 | /** Open the AI debug window if one of the AI scripts has crashed. */ |
| 1304 | void 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 | } |
no test coverage detected