Loading

Paste #pvr6tv039

  1. Index: src/engine.cpp
  2. ===================================================================
  3. --- src/engine.cpp  (revision 27699)
  4. +++ src/engine.cpp  (working copy)
  5. @@ -48,11 +48,6 @@
  6.   */
  7.  static Year _year_engine_aging_stops;
  8.  
  9. -/**
  10. - * The railtypes that have been or never will be introduced, or
  11. - * an inverse bitmap of rail types that have to be introduced. */
  12. -static uint16 _introduced_railtypes;
  13. -
  14.  /** Number of engines of each vehicle type in original engine data */
  15.  const uint8 _engine_counts[4] = {
  16.     lengthof(_orig_rail_vehicle_info),
  17. @@ -543,31 +538,8 @@
  18.         const Engine *e = new Engine(eid->type, eid->internal_id);
  19.         assert(e->index == index);
  20.     }
  21. -
  22. -   _introduced_railtypes = 0;
  23.  }
  24.  
  25. -/**
  26. - * Check whether the railtypes should be introduced.
  27. - */
  28. -static void CheckRailIntroduction()
  29. -{
  30. -   /* All railtypes have been introduced. */
  31. -   if (_introduced_railtypes == UINT16_MAX || Company::GetPoolSize() == 0) return;
  32. -
  33. -   /* We need to find the railtypes that are known to all companies. */
  34. -   RailTypes rts = (RailTypes)UINT16_MAX;
  35. -
  36. -   /* We are at, or past the introduction date of the rail. */
  37. -   Company *c;
  38. -   FOR_ALL_COMPANIES(c) {
  39. -       c->avail_railtypes = AddDateIntroducedRailTypes(c->avail_railtypes, _date);
  40. -       rts &= c->avail_railtypes;
  41. -   }
  42. -
  43. -   _introduced_railtypes |= rts;
  44. -}
  45. -
  46.  void ShowEnginePreviewWindow(EngineID engine);
  47.  
  48.  /**
  49. @@ -711,19 +683,6 @@
  50.         c->avail_roadtypes = GetCompanyRoadtypes(c->index);
  51.     }
  52.  
  53. -   /* Rail types that are invalid or never introduced are marked as
  54. -    * being introduced upon start. That way we can easily check whether
  55. -    * there is any date related introduction that is still going to
  56. -    * happen somewhere in the future. */
  57. -   for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
  58. -       const RailtypeInfo *rti = GetRailTypeInfo(rt);
  59. -       if (rti->label != 0 && IsInsideMM(rti->introduction_date, 0, MAX_DAY)) continue;
  60. -
  61. -       SetBit(_introduced_railtypes, rt);
  62. -   }
  63. -
  64. -   CheckRailIntroduction();
  65. -
  66.     /* Invalidate any open purchase lists */
  67.     InvalidateWindowClassesData(WC_BUILD_VEHICLE);
  68.  }
  69. @@ -820,7 +779,10 @@
  70.  /** Daily check to offer an exclusive engine preview to the companies. */
  71.  void EnginesDailyLoop()
  72.  {
  73. -   CheckRailIntroduction();
  74. +   Company *c;
  75. +   FOR_ALL_COMPANIES(c) {
  76. +       c->avail_railtypes = AddDateIntroducedRailTypes(c->avail_railtypes, _date);
  77. +   }
  78.  
  79.     if (_cur_year >= _year_engine_aging_stops) return;
  80.  
  81.  

Comments