summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-04-26 19:30:31 +0000
committeryexo <yexo@openttd.org>2009-04-26 19:30:31 +0000
commitbc8f31da4e1ab66d67dd4e14f32b2a70ed94de59 (patch)
tree924879f01986f315cb622ba3881b44ea253d733f /src/ai
parentc7715b263ff9c58ac58fe2f87c952beac8c25cb0 (diff)
downloadopenttd-bc8f31da4e1ab66d67dd4e14f32b2a70ed94de59.tar.xz
(svn r16174) -Fix (r16093) [FS#2863]: crash when starting a game/loading a game with no AIs available.
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_instance.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp
index 8bd6db7f6..0ad34836b 100644
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -256,15 +256,15 @@ void AIInstance::Died()
this->engine = NULL;
ShowAIDebugWindow(_current_company);
- if (strcmp(GetCompany(_current_company)->ai_info->GetMainScript(), "%_dummy") != 0) {
- ShowErrorMessage(INVALID_STRING_ID, STR_AI_PLEASE_REPORT_CRASH, 0, 0);
- return;
- }
const AIInfo *info = AIConfig::GetConfig(_current_company)->GetInfo();
- if (info->GetURL() != NULL) {
- AILog::Info("Please report the error to the following URL:");
- AILog::Info(info->GetURL());
+ if (info != NULL) {
+ ShowErrorMessage(INVALID_STRING_ID, STR_AI_PLEASE_REPORT_CRASH, 0, 0);
+
+ if (info->GetURL() != NULL) {
+ AILog::Info("Please report the error to the following URL:");
+ AILog::Info(info->GetURL());
+ }
}
}