(svn r24029) -Change: [NoAI] make AIEngine::IsArticulated return true if the articulated callback flag is set, don't try to run the callback.

This commit is contained in:
yexo
2012-03-14 20:49:54 +00:00
parent c7ae0b4db6
commit 1f0593e7ca
3 changed files with 12 additions and 1 deletions

View File

@@ -54,6 +54,16 @@ static EngineID GetNextArticulatedPart(uint index, EngineID front_type, Vehicle
return GetNewEngineID(front_engine->GetGRF(), front_engine->type, callback);
}
/**
* Does a NewGRF report that this should be an articulated vehicle?
* @param engine_type The engine to check.
* @return True iff the articulated engine callback flag is set.
*/
bool IsArticulatedEngine(EngineID engine_type)
{
return HasBit(EngInfo(engine_type)->callback_mask, CBM_VEHICLE_ARTIC_ENGINE);
}
/**
* Count the number of articulated parts of an engine.
* @param engine_type The engine to get the number of parts of.