diff options
author | alberth <alberth@openttd.org> | 2013-07-31 07:30:18 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2013-07-31 07:30:18 +0000 |
commit | 24d3594723d2afe6db7a6b90c09bad0aac2c07b0 (patch) | |
tree | fbefc7d42de6a81cf682f9780c2b47213c410000 | |
parent | 46901b73b24199fa80faa96c83164874c3954549 (diff) | |
download | openttd-24d3594723d2afe6db7a6b90c09bad0aac2c07b0.tar.xz |
(svn r25640) -Fix: Do not suggest a start date for the game when there will be no vehicles available at all.
-rw-r--r-- | src/engine.cpp | 10 | ||||
-rw-r--r-- | src/lang/english.txt | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 3067c183d..700475c1b 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -1112,12 +1112,16 @@ void CheckEngines() if (!e->IsEnabled()) continue; /* We have an available engine... yay! */ - if (e->flags & ENGINE_AVAILABLE && e->company_avail != 0) return; + if ((e->flags & ENGINE_AVAILABLE) != 0 && e->company_avail != 0) return; /* Okay, try to find the earliest date. */ min_date = min(min_date, e->info.base_intro); } - SetDParam(0, min_date); - ShowErrorMessage(STR_ERROR_NO_VEHICLES_AVAILABLE_YET, STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION, WL_WARNING); + if (min_date < INT32_MAX) { + SetDParam(0, min_date); + ShowErrorMessage(STR_ERROR_NO_VEHICLES_AVAILABLE_YET, STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION, WL_WARNING); + } else { + ShowErrorMessage(STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL, STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION, WL_WARNING); + } } diff --git a/src/lang/english.txt b/src/lang/english.txt index 5a3fdc738..cf6e04f4b 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -4316,6 +4316,8 @@ STR_ERROR_CAN_T_CHANGE_SERVICING :{WHITE}Can't ch STR_ERROR_VEHICLE_IS_DESTROYED :{WHITE}... vehicle is destroyed +STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL :{WHITE}No vehicles will be available at all +STR_ERROR_NO_VEHICLES_AVAILABLE_AT_ALL_EXPLANATION :{WHITE}Change your NewGRF configuration STR_ERROR_NO_VEHICLES_AVAILABLE_YET :{WHITE}No vehicles are available yet STR_ERROR_NO_VEHICLES_AVAILABLE_YET_EXPLANATION :{WHITE}Start a new game after {DATE_SHORT} or use a NewGRF that provides early vehicles |