(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:
@@ -114,7 +114,7 @@
|
||||
/* static */ bool AIGroup::SetAutoReplace(GroupID group_id, EngineID engine_id_old, EngineID engine_id_new)
|
||||
{
|
||||
EnforcePrecondition(false, IsValidGroup(group_id) || group_id == GROUP_ALL);
|
||||
EnforcePrecondition(false, AIEngine::IsValidEngine(engine_id_new));
|
||||
EnforcePrecondition(false, AIEngine::IsBuildable(engine_id_new));
|
||||
|
||||
return AIObject::DoCommand(0, group_id << 16, (engine_id_new << 16) | engine_id_old, CMD_SET_AUTOREPLACE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user