Loading

Paste #pmz1cua17

  1. /* static */ void AI::Stop(CompanyID company)
  2. {
  3.     if (_networking && !_network_server) return;
  4.  
  5.     Backup<CompanyByte> cur_company(_current_company, company, FILE_LINE);
  6.     Company *c = Company::Get(company);
  7.  
  8.     delete c->ai_instance;
  9.     c->ai_instance = NULL;
  10.     c->ai_info = NULL;
  11.  
  12.     cur_company.Restore();
  13.  
  14.     InvalidateWindowData(WC_AI_DEBUG, 0, -1);
  15.  
  16.     if (AIConfig::GetConfig(company)->IsRandom()) {
  17.         AIConfig::GetConfig(company)->Change(NULL);
  18.     }
  19.     InvalidateWindowData(WC_AI_SETTINGS, company);
  20. }

Comments