| 59 | } |
| 60 | |
| 61 | void AIInstance::Died() |
| 62 | { |
| 63 | ScriptInstance::Died(); |
| 64 | |
| 65 | /* Intro is not supposed to use AI, but it may have 'dummy' AI which instant dies. */ |
| 66 | if (_game_mode == GM_MENU) return; |
| 67 | |
| 68 | /* Don't show errors while loading savegame. They will be shown at end of loading anyway. */ |
| 69 | if (_switch_mode != SM_NONE) return; |
| 70 | |
| 71 | ShowScriptDebugWindow(_current_company); |
| 72 | |
| 73 | const AIInfo *info = AIConfig::GetConfig(_current_company)->GetInfo(); |
| 74 | if (info != nullptr) { |
| 75 | ShowErrorMessage(GetEncodedString(STR_ERROR_AI_PLEASE_REPORT_CRASH), {}, WL_WARNING); |
| 76 | |
| 77 | if (!info->GetURL().empty()) { |
| 78 | ScriptLog::Info("Please report the error to the following URL:"); |
| 79 | ScriptLog::Info(info->GetURL()); |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | void AIInstance::LoadDummyScript() |
| 85 | { |
no test coverage detected