From 70aab8bf0487ef506afbeaa6cb8e46309387df84 Mon Sep 17 00:00:00 2001 From: smatz Date: Mon, 18 May 2009 19:32:16 +0000 Subject: (svn r16354) -Codechange: use 'new' pool accessors and methods for Engine too --- src/ai/api/ai_engine.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ai') 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) -- cgit v1.2.3-70-g09d2