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_controller.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_controller.cpp')
-rw-r--r-- | src/ai/api/ai_controller.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ai/api/ai_controller.cpp b/src/ai/api/ai_controller.cpp index 0c478cf4a..78dee1d21 100644 --- a/src/ai/api/ai_controller.cpp +++ b/src/ai/api/ai_controller.cpp @@ -63,12 +63,12 @@ AIController::~AIController() /* static */ uint AIController::GetTick() { - return ::Company::Get(_current_company)->ai_instance->GetController()->ticks; + return AIObject::GetActiveInstance()->GetController()->ticks; } /* static */ int AIController::GetOpsTillSuspend() { - return ::Company::Get(_current_company)->ai_instance->GetOpsTillSuspend(); + return AIObject::GetActiveInstance()->GetOpsTillSuspend(); } /* static */ int AIController::GetSetting(const char *name) |