* Check if towns are able to build road. * @return true iff the towns are currently able to build road. */
| 1013 | * @return true iff the towns are currently able to build road. |
| 1014 | */ |
| 1015 | bool CheckTownRoadTypes() |
| 1016 | { |
| 1017 | auto min_date = GetTownRoadTypeFirstIntroductionDate(); |
| 1018 | if (min_date <= TimerGameCalendar::date) return true; |
| 1019 | |
| 1020 | if (min_date < INT32_MAX) { |
| 1021 | ShowErrorMessage( |
| 1022 | GetEncodedString(STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET), |
| 1023 | GetEncodedString(STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_YET_EXPLANATION, min_date), |
| 1024 | WL_CRITICAL); |
| 1025 | } else { |
| 1026 | ShowErrorMessage( |
| 1027 | GetEncodedString(STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL), |
| 1028 | GetEncodedString(STR_ERROR_NO_TOWN_ROADTYPES_AVAILABLE_AT_ALL_EXPLANATION), WL_CRITICAL); |
| 1029 | } |
| 1030 | return false; |
| 1031 | } |
| 1032 | |
| 1033 | /** |
| 1034 | * Check for parallel road inside a given distance. |
no test coverage detected