diff options
author | truebrain <truebrain@openttd.org> | 2011-11-13 20:43:48 +0000 |
---|---|---|
committer | truebrain <truebrain@openttd.org> | 2011-11-13 20:43:48 +0000 |
commit | b7a655bf4cafc68e14cade593e8b1aca7f04f7dd (patch) | |
tree | 1880bbb64896193511e72c23c9387af2bb19acae /src/ai/api/ai_execmode.cpp | |
parent | 407514a590dc06c8b80c5304b5e9227c8c844f91 (diff) | |
download | openttd-b7a655bf4cafc68e14cade593e8b1aca7f04f7dd.tar.xz |
(svn r23209) -Codechange: track the current active script instance directly, instead of assuming the current company points you to the right one.
Diffstat (limited to 'src/ai/api/ai_execmode.cpp')
-rw-r--r-- | src/ai/api/ai_execmode.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/ai/api/ai_execmode.cpp b/src/ai/api/ai_execmode.cpp index e661a1068..f5e1e502b 100644 --- a/src/ai/api/ai_execmode.cpp +++ b/src/ai/api/ai_execmode.cpp @@ -32,9 +32,8 @@ AIExecMode::AIExecMode() AIExecMode::~AIExecMode() { if (this->GetDoCommandModeInstance() != this) { - AIInstance *instance = Company::Get(_current_company)->ai_instance; /* Ignore this error if the AI already died. */ - if (!instance->IsDead()) { + if (!AIObject::GetActiveInstance()->IsDead()) { throw AI_FatalError("AIExecMode object was removed while it was not the latest AI*Mode object created."); } } |