Loading

Paste #pdsesmvi1

  1.     /* Compute number of AI companies to start. */
  2.     uint ais_to_start = 0;
  3.     CompanyMask company_mask = 0;
  4.     for (;;) {
  5.         if (_networking && current_companies + ais_to_start >= _settings_client.network.max_companies) break;
  6.         if (current_ais + ais_to_start >= (uint)_settings_game.difficulty.max_no_competitors) break;
  7.  
  8.         CompanyID company = AI::GetStartNextCompany(ais_to_start);
  9.         assert(company != INVALID_COMPANY);
  10.         assert(!HasBit(company_mask, company));
  11.         SetBit(company_mask, company);
  12.  
  13.         /* Check if the next AI is also scheduled to start immediately */
  14.         ais_to_start++;
  15.         if (AI::GetStartNextTime(ais_to_start) != 0) break;
  16.     }

Comments