diff options
author | smatz <smatz@openttd.org> | 2009-05-18 19:32:16 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2009-05-18 19:32:16 +0000 |
commit | 70aab8bf0487ef506afbeaa6cb8e46309387df84 (patch) | |
tree | e0c2fdd130c4c93d249ca7ecb2860e454d6b4e7f /src/ai/api | |
parent | a0ff6363e6429fded7bd39adacd14a191ef00526 (diff) | |
download | openttd-70aab8bf0487ef506afbeaa6cb8e46309387df84.tar.xz |
(svn r16354) -Codechange: use 'new' pool accessors and methods for Engine too
Diffstat (limited to 'src/ai/api')
-rw-r--r-- | src/ai/api/ai_engine.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ai/api/ai_engine.cpp b/src/ai/api/ai_engine.cpp index 5e0ac5b4a..64c85de04 100644 --- a/src/ai/api/ai_engine.cpp +++ b/src/ai/api/ai_engine.cpp @@ -15,7 +15,8 @@ /* static */ bool AIEngine::IsValidEngine(EngineID engine_id) { - return ::IsEngineIndex(engine_id) && HasBit(::Engine::Get(engine_id)->company_avail, _current_company); + const Engine *e = ::Engine::GetIfValid(engine_id); + return e != NULL && HasBit(e->company_avail, _current_company); } /* static */ char *AIEngine::GetName(EngineID engine_id) |