Loading

Paste #pdivs5ok2

  1. 1. Subtypes available to specific company at current date
  2. -> Company::avail_roadtype
  3.  
  4.  
  5.  
  6. 2. Subtypes available to any company at current date
  7. FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) {
  8.        /* Check if the subtype can be used in the current climate */
  9.        if (!HasBit(e->info.climates,  _settings_game.game_creation.landscape)) continue;
  10.  
  11.        /* Check whether available for all potential companies */
  12.        if (e->company_available != (CompanyMask)-1) continue;
  13.  
  14.        RoadTypeIdentifier rtid = e->GetRoadType();
  15.        if (rtid.basetype != rt) continue;
  16.  
  17.        known_roadsubtypes |= GetRoadTypeInfo(rtid)->introduces_roadtypes;
  18. }
  19.  
  20. /* Get the date introduced roadtypes as well. */
  21. known_roadsubtypes = AddDateIntroducedRoadTypes(rt, known_roadsubtypes, _current_date);
  22.  
  23.  
  24.  
  25. 3. Subtypes available to any company at any date
  26. FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) {
  27.        /* Check if the subtype can be used in the current climate */
  28.        if (!HasBit(e->info.climates,  _settings_game.game_creation.landscape)) continue;
  29.  
  30.        RoadTypeIdentifier rtid = e->GetRoadType();
  31.        if (rtid.basetype != rt) continue;
  32.  
  33.        known_roadsubtypes |= GetRoadTypeInfo(rtid)->introduces_roadtypes;
  34. }
  35.  
  36. /* Get the date introduced roadtypes as well. */
  37. known_roadsubtypes = AddDateIntroducedRoadTypes(rt, known_roadsubtypes, MAX_DAY);

Comments