(svn r18687) -Add [NoAI]: AIEngine::IsBuildable to check if you can build a certain engine.

-Change: AIEngine::IsValidEngine will now also return true when you have at least one vehicle of that type even if you can't build it anymore.
This commit is contained in:
yexo
2010-01-02 15:52:29 +00:00
parent 2f29975421
commit 8f50437298
9 changed files with 186 additions and 5 deletions

View File

@@ -64,7 +64,7 @@
/* static */ VehicleID AIVehicle::BuildVehicle(TileIndex depot, EngineID engine_id)
{
EnforcePrecondition(INVALID_VEHICLE, AIEngine::IsValidEngine(engine_id));
EnforcePrecondition(INVALID_VEHICLE, AIEngine::IsBuildable(engine_id));
::VehicleType type = ::Engine::Get(engine_id)->type;