Loading

Paste #ppls1aleu

  1. diff --git a/src/road_gui.cpp b/src/road_gui.cpp
  2. index 015f952..171b28a 100644
  3. --- a/src/road_gui.cpp
  4. +++ b/src/road_gui.cpp
  5. @@ -312,7 +312,19 @@ struct BuildRoadToolbarWindow : Window {
  6.             DeleteWindowById(WC_BUS_STATION, TRANSPORT_ROAD);
  7.             DeleteWindowById(WC_TRUCK_STATION, TRANSPORT_ROAD);
  8.  
  9. -           if (this->roadtype_identifier.IsTram()) delete this;
  10. +           //if (this->roadtype_identifier.IsTram()) delete this;
  11. +           RoadSubTypes used_roadtypes = ROADSUBTYPES_NONE;
  12. +           Engine *e;
  13. +           FOR_ALL_ENGINES_OF_TYPE(e, VEH_ROAD) {
  14. +               if (!HasBit(e->info.climates, _settings_game.game_creation.landscape)) continue;
  15. +
  16. +               RoadTypeIdentifier rtid = e->GetRoadType();
  17. +               if (rtid.basetype != this->roadtype_identifier.basetype) continue;
  18. +
  19. +               used_roadtypes |= GetRoadTypeInfo(rtid)->introduces_roadtypes;
  20. +           }
  21. +
  22. +           if (!HasBit(used_roadtypes, this->roadtype_identifier.subtype)) delete this;
  23.         }
  24.     }
  25.  
  26. @@ -1351,7 +1363,7 @@ DropDownList *GetScenRoadTypeDropDownList(RoadTypes roadtypes)
  27.         /* If it's not used ever, don't show it to the user. */
  28.         RoadTypeIdentifier rtid;
  29.         FOR_ALL_SORTED_ROADTYPES(rtid, rt) {
  30. -           if (!HasBit(used_roadtypes, rtid.subtype)) continue;
  31. +           //DISABLED FOR TEST : if (!HasBit(used_roadtypes, rtid.subtype)) continue;
  32.  
  33.             const RoadtypeInfo *rti = GetRoadTypeInfo(rtid);

Comments