/* Count number of AI companies to start. */ uint num_to_start = 0; do { if (_networking && num_companies + num_to_start >= _settings_client.network.max_companies) break; if (num_ais + num_to_start >= (uint)_settings_game.difficulty.max_no_competitors) break; num_to_start++; } while (AI::GetStartNextTime(num_to_start) == 0); uint num_to_start_for = 0; for (;; ++num_to_start_for) { if (AI::GetStartNextTime(num_to_start_for) == 0) { if (_networking && num_companies + num_to_start_for >= _settings_client.network.max_companies) break; if (num_ais + num_to_start_for >= (uint)_settings_game.difficulty.max_no_competitors) break; } else { break; } } assert(num_to_start == num_to_start_for);