(svn r16354) -Codechange: use 'new' pool accessors and methods for Engine too

This commit is contained in:
smatz
2009-05-18 19:32:16 +00:00
parent a0ff6363e6
commit 70aab8bf04
5 changed files with 15 additions and 22 deletions

View File

@@ -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)