diff --git a/src/ai/ai_core.cpp b/src/ai/ai_core.cpp index 8d333877fd..ab950ef069 100644 --- a/src/ai/ai_core.cpp +++ b/src/ai/ai_core.cpp @@ -48,13 +48,15 @@ config->ChangeAI(info->GetName(), -1, false, true); } - _current_company = company; + Backup cur_company(_current_company, company, FILE_LINE); Company *c = Company::Get(company); c->ai_info = info; assert(c->ai_instance == NULL); c->ai_instance = new AIInstance(info); + cur_company.Restore(); + InvalidateWindowData(WC_AI_DEBUG, 0, -1); return; }