summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-02-07 17:01:44 +0000
committersmatz <smatz@openttd.org>2009-02-07 17:01:44 +0000
commit487b0ed95ec13a32b2f2db7b6212e4b76eed5332 (patch)
tree305d5ee3576b73014506aed429f2b904997bad63
parentf1240daed6d7c9d80170594145550a66ec2c7a71 (diff)
downloadopenttd-487b0ed95ec13a32b2f2db7b6212e4b76eed5332.tar.xz
(svn r15401) -Fix [FS#2619](r15027): AI::Stop changed _current_company, but didn't restore its original value
-rw-r--r--src/ai/ai_core.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ai/ai_core.cpp b/src/ai/ai_core.cpp
index e49a7dd4b..f4f703614 100644
--- a/src/ai/ai_core.cpp
+++ b/src/ai/ai_core.cpp
@@ -88,12 +88,15 @@
{
if (_networking && !_network_server) return;
+ CompanyID old_company = _current_company;
_current_company = company;
Company *c = GetCompany(company);
delete c->ai_instance;
c->ai_instance = NULL;
+ _current_company = old_company;
+
InvalidateWindowData(WC_AI_DEBUG, 0, -1);
}