diff --git a/bin/data/no_sound.obs b/bin/data/no_sound.obs new file mode 100644 index 0000000000..b6dd8cda1b --- /dev/null +++ b/bin/data/no_sound.obs @@ -0,0 +1,26 @@ +; $Id$ +; +; This represents more or less nothingness +; +[metadata] +name = NoSound +shortname = NULL +version = 2 +fallback = true +description = A sound pack without any sounds. +description.cs_CZ = Prázdná sada zvuků. +description.de_DE = Basissounds ohne Sound. +description.en_GB = A sound pack without any sounds. +description.en_US = A sound pack without any sounds. +description.es_ES = Un conjunto de sonidos vacío. +description.fi_FI = Äänipaketti ilman ääniä. +description.hu_HU = Üres hang alapcsomag. +description.nl_NL = Een geluidset zonder geluid. + +[files] +samples = + +[md5s] + +[origin] +default = This file was part of your OpenTTD installation. diff --git a/bin/data/orig_dos.obg b/bin/data/orig_dos.obg index c8a88a3297..4909b7929f 100644 --- a/bin/data/orig_dos.obg +++ b/bin/data/orig_dos.obg @@ -4,11 +4,19 @@ ; Tycoon Deluxe DOS CD. ; [metadata] -name = original_dos -shortname = TTDD -version = 1 -description = Original Transport Tycoon Deluxe DOS edition graphics -palette = DOS +name = original_dos +shortname = TTDD +version = 1 +palette = DOS +description = Original Transport Tycoon Deluxe DOS edition graphics. +description.cs_CZ = Původní sada grafik Transport Tycoon Deluxe (verze pro DOS). +description.de_DE = Original Transport Tycoon Deluxe DOS Basisgrafiken. +description.en_GB = Original Transport Tycoon Deluxe DOS edition graphics. +description.en_US = Original Transport Tycoon Deluxe DOS edition graphics. +description.es_ES = Gráficos originales de Transport Tycoon Deluxe versión DOS. +description.fi_FI = Alkuperäiset Transport Tycoon Deluxe DOS grafiikat. +description.hu_HU = Az eredeti Transport Tycoon Deluxe DOS-os verziójának grafikája. +description.nl_NL = Originele graphics van de Transport Tycoon Deluxe DOS-versie. [files] base = TRG1.GRF @@ -27,5 +35,4 @@ TRGT.GRF = e30e8a398ae86c03dc534a8ac7dfb3b6 OPENTTDD.GRF = 356cf9663aacb212fdbff609d99090d6 [origin] -default = You can find it on your Transport Tycoon Deluxe CD-ROM. -OPENTTDD.GRF = This file was part of your installation. +OPENTTDD.GRF = This file was part of your OpenTTD installation. diff --git a/bin/data/orig_dos.obs b/bin/data/orig_dos.obs index b342e314d9..95e3dedede 100644 --- a/bin/data/orig_dos.obs +++ b/bin/data/orig_dos.obs @@ -4,10 +4,18 @@ ; Tycoon Deluxe DOS CD. ; [metadata] -name = original_dos -shortname = TTDO -version = 0 -description = Original Transport Tycoon Deluxe DOS edition sounds +name = original_dos +shortname = TTDO +version = 0 +description = Original Transport Tycoon Deluxe DOS edition sounds. +description.cs_CZ = Původní sada zvuků Transport Tycoon Deluxe (verze pro DOS). +description.de_DE = Original Transport Tycoon Deluxe DOS Basissounds. +description.en_GB = Original Transport Tycoon Deluxe DOS edition sounds. +description.en_US = Original Transport Tycoon Deluxe DOS edition sounds. +description.es_ES = Sonidos originales de Transport Tycoon Deluxe versión DOS. +description.fi_FI = Alkuperäiset Transport Tycoon Deluxe DOS äänet. +description.hu_HU = Az eredeti Transport Tycoon Deluxe DOS-os verziójának hangjai. +description.nl_NL = Originele geluiden van de Transport Tycoon Deluxe DOS-versie. [files] samples = SAMPLE.CAT diff --git a/bin/data/orig_dos_de.obg b/bin/data/orig_dos_de.obg index fc808b3d58..f0a053eeef 100644 --- a/bin/data/orig_dos_de.obg +++ b/bin/data/orig_dos_de.obg @@ -4,11 +4,19 @@ ; Tycoon Deluxe DOS CD. It contains one broken sprite. ; [metadata] -name = original_dos_de -shortname = TTDD -version = 0 -description = Original Transport Tycoon Deluxe DOS (German) edition graphics -palette = DOS +name = original_dos_de +shortname = TTDD +version = 0 +palette = DOS +description = Original Transport Tycoon Deluxe DOS (German) edition graphics. +description.cs_CZ = Původní sada grafik Transport Tycoon Deluxe (německá verze pro DOS). +description.de_DE = Original Transport Tycoon Deluxe DOS (Deutsch) Basisgrafiken. +description.en_GB = Original Transport Tycoon Deluxe DOS (German) edition graphics. +description.en_US = Original Transport Tycoon Deluxe DOS (German) edition graphics. +description.es_ES = Gráficos originales de Transport Tycoon Deluxe versión DOS (Alemán). +description.fi_FI = Alkuperäiset Transport Tycoon Deluxe DOS (Saksalainen) grafiikat. +description.hu_HU = Az eredeti Transport Tycoon Deluxe DOS-os verziójának grafikája (német változat). +description.nl_NL = Originele graphics van de Duitse Transport Tycoon Deluxe DOS-versie. [files] base = TRG1.GRF @@ -28,4 +36,4 @@ OPENTTDD.GRF = 356cf9663aacb212fdbff609d99090d6 [origin] default = You can find it on your Transport Tycoon Deluxe CD-ROM. -OPENTTDD.GRF = This file was part of your installation. +OPENTTDD.GRF = This file was part of your OpenTTD installation. diff --git a/bin/data/orig_win.obg b/bin/data/orig_win.obg index 2a5bf19ea3..4e8d6a8ad8 100644 --- a/bin/data/orig_win.obg +++ b/bin/data/orig_win.obg @@ -4,11 +4,19 @@ ; Tycoon Deluxe for Windows CD. ; [metadata] -name = original_windows -shortname = TTDW -version = 0 -description = Original Transport Tycoon Deluxe Windows edition graphics -palette = Windows +name = original_windows +shortname = TTDW +version = 0 +palette = Windows +description = Original Transport Tycoon Deluxe Windows edition graphics. +description.cs_CZ = Původní sada grafik Transport Tycoon Deluxe (verze pro Windows). +description.de_DE = Original Transport Tycoon Deluxe Windows Basisgrafiken. +description.en_GB = Original Transport Tycoon Deluxe Windows edition graphics. +description.en_US = Original Transport Tycoon Deluxe Windows edition graphics. +description.es_ES = Gráficos originales de Transport Tycoon Deluxe versión Windows. +description.fi_FI = Alkuperäiset Transport Tycoon Deluxe Windows grafiikat. +description.hu_HU = Az eredeti Transport Tycoon Deluxe Windows-os verziójának grafikája. +description.nl_NL = Originele graphics van de Transport Tycoon Deluxe Windows-versie. [files] base = TRG1R.GRF @@ -28,4 +36,4 @@ OPENTTDW.GRF = 80346ea80de167068cfb975f93963941 [origin] default = You can find it on your Transport Tycoon Deluxe CD-ROM. -OPENTTDW.GRF = This file was part of your installation. +OPENTTDW.GRF = This file was part of your OpenTTD installation. diff --git a/bin/data/orig_win.obs b/bin/data/orig_win.obs index 71e3299629..e1cc1492ab 100644 --- a/bin/data/orig_win.obs +++ b/bin/data/orig_win.obs @@ -4,10 +4,18 @@ ; Tycoon Deluxe for Windows CD. ; [metadata] -name = original_windows -shortname = TTDO -version = 0 -description = Original Transport Tycoon Deluxe Windows edition sounds +name = original_windows +shortname = TTDO +version = 0 +description = Original Transport Tycoon Deluxe Windows edition sounds. +description.cs_CZ = Původní sada zvuků Transport Tycoon Deluxe (verze pro Windows). +description.de_DE = Original Transport Tycoon Deluxe Windows Basissounds. +description.en_GB = Original Transport Tycoon Deluxe Windows edition sounds. +description.en_US = Original Transport Tycoon Deluxe Windows edition sounds. +description.es_ES = Sonidos originales de Transport Tycoon Deluxe versión Windows. +description.fi_FI = Alkuperäiset Transport Tycoon Deluxe Windows äänet. +description.hu_HU = Az eredeti Transport Tycoon Deluxe Windows-os verziójának hangjai. +description.nl_NL = Originele geluiden van de Transport Tycoon Deluxe Windows-versie. [files] samples = SAMPLE.CAT diff --git a/bin/gm/no_music.obm b/bin/gm/no_music.obm index 0a325bede8..f86bdcfc06 100644 --- a/bin/gm/no_music.obm +++ b/bin/gm/no_music.obm @@ -3,10 +3,19 @@ ; This represents more or less nothingness ; [metadata] -name = NoMusic -shortname = NOMU -version = 0 -description = A music pack without actual music +name = NoMusic +shortname = NULL +version = 0 +fallback = true +description = A music pack without actual music. +description.cs_CZ = Prázná hudební sada. +description.de_DE = Ein Musikset ohne Musik. +description.en_GB = A music pack without actual music. +description.en_US = A music pack without actual music. +description.es_ES = Un conjunto de música vacío. +description.fi_FI = Musiikkipaketti, jossa ei ole musiikkia. +description.hu_HU = Üres zenei alapcsomag. +description.nl_NL = Een muziekset zonder muziek. [files] theme = @@ -46,3 +55,4 @@ ezy_9 = [names] [origin] +default = This file was part of your OpenTTD installation. diff --git a/bin/gm/orig_win.obm b/bin/gm/orig_win.obm index 121ef13b9c..e3e0cc024c 100644 --- a/bin/gm/orig_win.obm +++ b/bin/gm/orig_win.obm @@ -4,10 +4,18 @@ ; Tycoon Deluxe for Windows CD. ; [metadata] -name = original_windows -shortname = TTDW -version = 1 -description = Original Transport Tycoon Deluxe Windows edition music +name = original_windows +shortname = TTDW +version = 1 +description = Original Transport Tycoon Deluxe Windows edition music. +description.cs_CZ = Původní hudba Transport Tycoon Deluxe (verze pro Windows). +description.de_DE = Original Transport Tycoon Deluxe Windows Musikset. +description.en_GB = Original Transport Tycoon Deluxe Windows edition sounds. +description.en_US = Original Transport Tycoon Deluxe Windows edition sounds. +description.es_ES = Música original de Transport Tycoon Deluxe versión Windows. +description.fi_FI = Alkuperäinen Transport Tycoon Deluxe Windows musiikki. +description.hu_HU = Az eredeti Transport Tycoon Deluxe Windows-os verziójának zenéje. +description.nl_NL = Originele muziek van de Transport Tycoon Deluxe Windows-versie. [files] theme = GM_TT00.GM @@ -91,4 +99,4 @@ GM_TT20.GM = Jammit GM_TT21.GM = Movin' On [origin] -default = You can find it on your Transport Tycoon Deluxe CD-ROM. +default = You can find it on your Transport Tycoon Deluxe CD-ROM. diff --git a/os/windows/installer/install.nsi b/os/windows/installer/install.nsi index 417d68680e..43b86890b6 100644 --- a/os/windows/installer/install.nsi +++ b/os/windows/installer/install.nsi @@ -16,7 +16,7 @@ !define OPENGFX_BASE_VERSION "0.7.0" !define OPENSFX_BASE_VERSION "0.8.0" -!define NOSOUND_BASE_VERSION "0.8.0" +!define OPENMSX_BASE_VERSION "1.0.0" !define MUI_ICON "..\..\..\media\openttd.ico" !define MUI_UNICON "..\..\..\media\openttd.ico" @@ -238,21 +238,21 @@ Done: SectionEnd ;---------------------------------------------------------------------------------- -; NoSound files install section. Downloads NoSound and installs it -Section "Download NoSound (free sound set)" Section5 +; OpenMSX files install section. Downloads OpenMSX and installs it +Section "Download OpenMSX (free music set)" Section5 SetOverwrite try - NSISdl::download "http://binaries.openttd.org/installer/nosound-${NOSOUND_BASE_VERSION}.7z" "$INSTDIR\data\nosound.7z" + NSISdl::download "http://binaries.openttd.org/installer/openmsx-${OPENMSX_BASE_VERSION}.7z" "$INSTDIR\gm\openmsx.7z" Pop $R0 ;Get the return value StrCmp $R0 "success" +3 - MessageBox MB_OK "Downloading of NoSound failed" + MessageBox MB_OK "Downloading of OpenMSX failed" Goto Done ; Let's extract the files - SetOutPath "$INSTDIR\data\" - NSIS7z::Extract "$INSTDIR\data\nosound.7z" + SetOutPath "$INSTDIR\gm\" + NSIS7z::Extract "$INSTDIR\gm\openmsx.7z" - Delete "$INSTDIR\data\nosound.7z" + Delete "$INSTDIR\gm\openmsx.7z" SetOutPath "$INSTDIR\" Done: @@ -294,8 +294,8 @@ SectionEnd !insertmacro MUI_DESCRIPTION_TEXT ${Section6} "Translations of OpenTTD." !insertmacro MUI_DESCRIPTION_TEXT ${Section3} "Download the free OpenGFX game graphics set. This download is about 3 MiB." !insertmacro MUI_DESCRIPTION_TEXT ${Section4} "Download the free OpenSFX game sound set. This download is about 10 MiB." - !insertmacro MUI_DESCRIPTION_TEXT ${Section5} "Download the free NoSound game sound set. You will not hear anything with this. This download is about 7 KiB." - !insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Copies the game graphics and sounds from the Transport Tycoon Deluxe CD." + !insertmacro MUI_DESCRIPTION_TEXT ${Section5} "Download the free OpenMSX game music set. This download is about 200 KiB." + !insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Copies the game graphics, sounds and music from the Transport Tycoon Deluxe CD." !insertmacro MUI_FUNCTION_DESCRIPTION_END ;----------------------------------------------- @@ -377,6 +377,7 @@ Section "Uninstall" Delete "$INSTDIR\data\orig_dos_de.obg" Delete "$INSTDIR\data\orig_win.obs" Delete "$INSTDIR\data\orig_dos.obs" + Delete "$INSTDIR\data\no_sound.obs" Delete "$INSTDIR\data\sample.cat" ; Windows Data files @@ -395,13 +396,13 @@ Section "Uninstall" ; Music Delete "$INSTDIR\gm\*.gm" - ; Downloaded OpenGFX/OpenSFX/NoSound + ; Downloaded OpenGFX/OpenSFX/OpenMSX Delete "$INSTDIR\data\opengfx\*" RMDir "$INSTDIR\data\opengfx" Delete "$INSTDIR\data\opensfx\*" RMDir "$INSTDIR\data\opensfx" - Delete "$INSTDIR\data\nosound\*" - RMDir "$INSTDIR\data\nosound" + Delete "$INSTDIR\gm\openmsx\*" + RMDir "$INSTDIR\gm\openmsx" ; Language files Delete "$INSTDIR\lang\*.lng" @@ -549,7 +550,7 @@ Function .onInit SectionSetSize ${Section3} 6144 SectionSetSize ${Section4} 13312 - SectionSetSize ${Section5} 30 + SectionSetSize ${Section5} 1024 SectionSetFlags 0 17 diff --git a/projects/generate b/projects/generate index 1d00f66f00..c9ac42d4a4 100755 --- a/projects/generate +++ b/projects/generate @@ -161,8 +161,8 @@ load_lang_data() { diff --git a/projects/generate.vbs b/projects/generate.vbs index f1eb789a58..0f289bc13b 100755 --- a/projects/generate.vbs +++ b/projects/generate.vbs @@ -210,8 +210,8 @@ Function load_lang_data(dir) & vbCrLf & " " _ & vbCrLf & " " _ diff --git a/projects/langs_vs80.vcproj b/projects/langs_vs80.vcproj index 7775bf08f7..ef86531b4f 100644 --- a/projects/langs_vs80.vcproj +++ b/projects/langs_vs80.vcproj @@ -55,8 +55,8 @@ @@ -70,8 +70,8 @@ @@ -85,8 +85,8 @@ @@ -100,8 +100,8 @@ @@ -115,8 +115,8 @@ @@ -130,8 +130,8 @@ @@ -145,8 +145,8 @@ @@ -160,8 +160,8 @@ @@ -175,8 +175,8 @@ @@ -190,8 +190,8 @@ @@ -205,8 +205,8 @@ @@ -220,8 +220,8 @@ @@ -235,8 +235,8 @@ @@ -250,8 +250,8 @@ @@ -265,8 +265,8 @@ @@ -280,8 +280,8 @@ @@ -295,8 +295,8 @@ @@ -310,8 +310,8 @@ @@ -325,8 +325,8 @@ @@ -340,8 +340,8 @@ @@ -355,8 +355,8 @@ @@ -370,8 +370,8 @@ @@ -385,8 +385,8 @@ @@ -400,8 +400,8 @@ @@ -415,8 +415,8 @@ @@ -430,8 +430,8 @@ @@ -445,8 +445,8 @@ @@ -460,8 +460,8 @@ @@ -475,8 +475,8 @@ @@ -490,8 +490,8 @@ @@ -505,8 +505,8 @@ @@ -520,8 +520,8 @@ @@ -535,8 +535,8 @@ @@ -550,8 +550,8 @@ @@ -565,8 +565,8 @@ @@ -580,8 +580,8 @@ @@ -595,8 +595,8 @@ @@ -610,8 +610,8 @@ @@ -625,8 +625,8 @@ @@ -640,8 +640,8 @@ @@ -655,8 +655,8 @@ @@ -670,8 +670,8 @@ @@ -685,8 +685,8 @@ @@ -700,8 +700,8 @@ @@ -715,8 +715,8 @@ @@ -730,8 +730,8 @@ diff --git a/projects/langs_vs90.vcproj b/projects/langs_vs90.vcproj index 16bec30f98..33aa15423e 100644 --- a/projects/langs_vs90.vcproj +++ b/projects/langs_vs90.vcproj @@ -56,8 +56,8 @@ @@ -71,8 +71,8 @@ @@ -86,8 +86,8 @@ @@ -101,8 +101,8 @@ @@ -116,8 +116,8 @@ @@ -131,8 +131,8 @@ @@ -146,8 +146,8 @@ @@ -161,8 +161,8 @@ @@ -176,8 +176,8 @@ @@ -191,8 +191,8 @@ @@ -206,8 +206,8 @@ @@ -221,8 +221,8 @@ @@ -236,8 +236,8 @@ @@ -251,8 +251,8 @@ @@ -266,8 +266,8 @@ @@ -281,8 +281,8 @@ @@ -296,8 +296,8 @@ @@ -311,8 +311,8 @@ @@ -326,8 +326,8 @@ @@ -341,8 +341,8 @@ @@ -356,8 +356,8 @@ @@ -371,8 +371,8 @@ @@ -386,8 +386,8 @@ @@ -401,8 +401,8 @@ @@ -416,8 +416,8 @@ @@ -431,8 +431,8 @@ @@ -446,8 +446,8 @@ @@ -461,8 +461,8 @@ @@ -476,8 +476,8 @@ @@ -491,8 +491,8 @@ @@ -506,8 +506,8 @@ @@ -521,8 +521,8 @@ @@ -536,8 +536,8 @@ @@ -551,8 +551,8 @@ @@ -566,8 +566,8 @@ @@ -581,8 +581,8 @@ @@ -596,8 +596,8 @@ @@ -611,8 +611,8 @@ @@ -626,8 +626,8 @@ @@ -641,8 +641,8 @@ @@ -656,8 +656,8 @@ @@ -671,8 +671,8 @@ @@ -686,8 +686,8 @@ @@ -701,8 +701,8 @@ @@ -716,8 +716,8 @@ @@ -731,8 +731,8 @@ diff --git a/src/base_media_base.h b/src/base_media_base.h index 7567d1b812..4b43c24fd8 100644 --- a/src/base_media_base.h +++ b/src/base_media_base.h @@ -59,6 +59,7 @@ struct BaseSet { TranslatedStrings description; ///< Description of the base set uint32 shortname; ///< Four letter short variant of the name uint32 version; ///< The version of this base set + bool fallback; ///< This set is a fallback set, i.e. it should be used only as last resort MD5File files[NUM_FILES]; ///< All files part of this set uint found_files; ///< Number of the files that could be found @@ -107,9 +108,10 @@ struct BaseSet { * Read the set information from a loaded ini. * @param ini the ini to read from * @param path the path to this ini file (for filenames) + * @param allow_empty_filename empty filenames are valid * @return true if loading was successful. */ - bool FillSetDetails(IniFile *ini, const char *path); + bool FillSetDetails(IniFile *ini, const char *path, bool allow_empty_filename = true); /** * Get the description for the given ISO code. diff --git a/src/base_media_func.h b/src/base_media_func.h index 6a77501c4d..aa339452c6 100644 --- a/src/base_media_func.h +++ b/src/base_media_func.h @@ -30,7 +30,7 @@ template /* static */ Tbase_set *BaseMedia::availab } template -bool BaseSet::FillSetDetails(IniFile *ini, const char *path) +bool BaseSet::FillSetDetails(IniFile *ini, const char *path, bool allow_empty_filename) { memset(this, 0, sizeof(*this)); @@ -58,6 +58,9 @@ bool BaseSet::FillSetDetails(IniFile *ini, const char *p fetch_metadata("version"); this->version = atoi(item->value); + item = metadata->GetItem("fallback", false); + this->fallback = (item != NULL && strcmp(item->value, "0") != 0 && strcmp(item->value, "false") != 0); + /* For each of the file types we want to find the file, MD5 checksums and warning messages. */ IniGroup *files = ini->GetGroup("files"); IniGroup *md5s = ini->GetGroup("md5s"); @@ -66,7 +69,7 @@ bool BaseSet::FillSetDetails(IniFile *ini, const char *p MD5File *file = &this->files[i]; /* Find the filename first. */ item = files->GetItem(BaseSet::file_names[i], false); - if (item == NULL) { + if (item == NULL || (item->value == NULL && !allow_empty_filename)) { DEBUG(grf, 0, "No " SET_TYPE " file for: %s", BaseSet::file_names[i]); return false; } diff --git a/src/engine.cpp b/src/engine.cpp index f3d8133ec0..8e6c41ba00 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -184,12 +184,12 @@ uint Engine::GetDisplayDefaultCapacity(uint16 *mail_capacity) const return GetEngineProperty(this->index, PROP_SHIP_CARGO_CAPACITY, this->u.ship.capacity); case VEH_AIRCRAFT: { - uint capacity = this->u.air.passenger_capacity; + uint capacity = GetEngineProperty(this->index, PROP_AIRCRAFT_PASSENGER_CAPACITY, this->u.air.passenger_capacity);; CargoID cargo = this->GetDefaultCargoType(); if (IsCargoInClass(cargo, CC_PASSENGERS)) { - if (mail_capacity != NULL) *mail_capacity = this->u.air.mail_capacity; + if (mail_capacity != NULL) *mail_capacity = GetEngineProperty(this->index, PROP_AIRCRAFT_MAIL_CAPACITY, this->u.air.mail_capacity); } else { - capacity += this->u.air.mail_capacity; + capacity += GetEngineProperty(this->index, PROP_AIRCRAFT_MAIL_CAPACITY, this->u.air.mail_capacity); } switch (cargo) { case CT_PASSENGERS: diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index 999d248562..f2678ae093 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -205,7 +205,7 @@ void GfxLoadSprites() bool GraphicsSet::FillSetDetails(IniFile *ini, const char *path) { - bool ret = this->BaseSet::FillSetDetails(ini, path); + bool ret = this->BaseSet::FillSetDetails(ini, path, false); if (ret) { IniGroup *metadata = ini->GetGroup("metadata"); IniItem *item; @@ -296,6 +296,7 @@ template if (c->GetNumMissing() != 0) continue; if (best == NULL || + (best->fallback && !c->fallback) || best->valid_files < c->valid_files || (best->valid_files == c->valid_files && ( (best->shortname == c->shortname && best->version < c->version) || diff --git a/src/lang/english.txt b/src/lang/english.txt index 327c5b180f..921215d4c6 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2903,10 +2903,10 @@ STR_VEHICLE_VIEW_ROAD_VEHICLE_SHOW_DETAILS_TOOLTIP :{BLACK}Show roa STR_VEHICLE_VIEW_SHIP_SHOW_DETAILS_TOOLTIP :{BLACK}Show ship details STR_VEHICLE_VIEW_AIRCRAFT_SHOW_DETAILS_TOOLTIP :{BLACK}Show aircraft details -STR_VEHICLE_VIEW_TRAIN_STATE_START_STOP_TOOLTIP :{BLACK}Current train action - click here to stop/start train -STR_VEHICLE_VIEW_ROAD_VEHICLE_STATE_START_STOP_TOOLTIP :{BLACK}Current vehicle action - click here to stop/start vehicle -STR_VEHICLE_VIEW_SHIP_STATE_START_STOP_TOOLTIP :{BLACK}Current ship action - click here to stop/start ship -STR_VEHICLE_VIEW_AIRCRAFT_STATE_START_STOP_TOOLTIP :{BLACK}Current aircraft action - click here to stop/start aircraft +STR_VEHICLE_VIEW_TRAIN_STATE_START_STOP_TOOLTIP :{BLACK}Current train action - click to stop/start train. Ctrl+Click to scroll to destination +STR_VEHICLE_VIEW_ROAD_VEHICLE_STATE_START_STOP_TOOLTIP :{BLACK}Current vehicle action - click to stop/start vehicle. Ctrl+Click to scroll to destination +STR_VEHICLE_VIEW_SHIP_STATE_START_STOP_TOOLTIP :{BLACK}Current ship action - click to stop/start ship. Ctrl+Click to scroll to destination +STR_VEHICLE_VIEW_AIRCRAFT_STATE_START_STOP_TOOLTIP :{BLACK}Current aircraft action - click to stop/start aircraft. Ctrl+Click to scroll to destination # Messages in the start stop button in the vehicle view STR_VEHICLE_STATUS_LOADING_UNLOADING :{LTBLUE}Loading / Unloading @@ -3307,6 +3307,9 @@ STR_ERROR_BMPMAP_IMAGE_TYPE :{WHITE}... coul STR_WARNING_HEIGHTMAP_SCALE_CAPTION :{WHITE}Scale warning STR_WARNING_HEIGHTMAP_SCALE_MESSAGE :{YELLOW}Resizing source map too much is not recommended. Continue with the generation? +# Soundset messages +STR_WARNING_FALLBACK_SOUNDSET :{WHITE}Only a fallback sound set was found. If you want sounds, install a sound set via the content download system. + # Screenshot related messages STR_MESSAGE_SCREENSHOT_SUCCESSFULLY :{WHITE}Screenshot successfully saved as '{RAW_STRING}' STR_ERROR_SCREENSHOT_FAILED :{WHITE}Screenshot failed! diff --git a/src/music.cpp b/src/music.cpp index e902f4b802..c4f15cc396 100644 --- a/src/music.cpp +++ b/src/music.cpp @@ -45,6 +45,7 @@ template if (c->GetNumMissing() != 0) continue; if (best == NULL || + (best->fallback && !c->fallback) || best->valid_files < c->valid_files || (best->valid_files == c->valid_files && (best->shortname == c->shortname && best->version < c->version))) { @@ -69,7 +70,19 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path) continue; } - IniItem *item = names->GetItem(filename, false); + IniItem *item = NULL; + /* As we possibly add a path to the filename and we compare + * on the filename with the path as in the .obm, we need to + * keep stripping path elements until we find a match. */ + for (const char *p = filename; p != NULL; p = strchr(p, PATHSEPCHAR)) { + /* Remove possible double path separator characters from + * the beginning, so we don't start reading e.g. root. */ + while (*p == PATHSEPCHAR) p++; + + item = names->GetItem(p, false); + if (item != NULL && !StrEmpty(item->value)) break; + } + if (item == NULL || StrEmpty(item->value)) { DEBUG(grf, 0, "Base music set song name missing: %s", filename); return false; diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 5f356d369d..598e9c6eda 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -1048,11 +1048,11 @@ static ChangeInfoResult AircraftVehicleChangeInfo(uint engine, int numinfo, int avi->running_cost = buf->ReadByte(); break; - case 0x0F: // Passenger capacity + case PROP_AIRCRAFT_PASSENGER_CAPACITY: // 0x0F Passenger capacity avi->passenger_capacity = buf->ReadWord(); break; - case 0x11: // Mail capacity + case PROP_AIRCRAFT_MAIL_CAPACITY: // 0x11 Mail capacity avi->mail_capacity = buf->ReadByte(); break; diff --git a/src/newgrf_properties.h b/src/newgrf_properties.h index 758791cafb..2f21352e00 100644 --- a/src/newgrf_properties.h +++ b/src/newgrf_properties.h @@ -39,6 +39,8 @@ enum PropertyID { PROP_AIRCRAFT_COST_FACTOR = 0x0B, ///< Purchase cost PROP_AIRCRAFT_SPEED = 0x0C, ///< Max. speed: 1 unit = 8 mph = 12.8 km-ish/h PROP_AIRCRAFT_RUNNING_COST_FACTOR = 0x0E, ///< Yearly runningcost + PROP_AIRCRAFT_PASSENGER_CAPACITY = 0x0F, ///< Passenger Capacity + PROP_AIRCRAFT_MAIL_CAPACITY = 0x11, ///< Mail Capacity }; #endif /* NEWGRF_PROPERTIES_H */ diff --git a/src/openttd.cpp b/src/openttd.cpp index 47f3e804af..a1559592ee 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1054,6 +1054,10 @@ void SwitchToMode(SwitchMode new_mode) case SM_MENU: // Switch to game intro menu LoadIntroGame(); + if (BaseSounds::ini_set == NULL && BaseSounds::GetUsedSet()->fallback) { + ShowErrorMessage(STR_WARNING_FALLBACK_SOUNDSET, INVALID_STRING_ID, 0, 0, true); + BaseSounds::ini_set = strdup(BaseSounds::GetUsedSet()->name); + } break; case SM_SAVE: // Save game diff --git a/src/order_base.h b/src/order_base.h index e75733a49e..3e74f4c79b 100644 --- a/src/order_base.h +++ b/src/order_base.h @@ -209,6 +209,7 @@ public: inline void SetConditionValue(uint16 value) { SB(this->dest, 0, 11, value); } bool ShouldStopAtStation(const Vehicle *v, StationID station) const; + TileIndex GetLocation(const Vehicle *v) const; /** Checks if this order has travel_time and if needed wait_time set. */ inline bool IsCompletelyTimetabled() const diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index c87493fc42..e1985893e3 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -408,16 +408,24 @@ static void DeleteOrderWarnings(const Vehicle *v) DeleteVehicleNews(v->index, STR_NEWS_VEHICLE_HAS_INVALID_ENTRY); } - -static TileIndex GetOrderLocation(const Order& o) +/** + * Returns a tile somewhat representing the order destination (not suitable for pathfinding). + * @param v The vehicle to get the location for. + * @return destination of order, or INVALID_TILE if none. + */ +TileIndex Order::GetLocation(const Vehicle *v) const { - switch (o.GetType()) { - default: NOT_REACHED(); - case OT_GOTO_WAYPOINT: return Waypoint::Get(o.GetDestination())->xy; - case OT_GOTO_STATION: return Station::Get(o.GetDestination())->xy; + switch (this->GetType()) { + case OT_GOTO_WAYPOINT: + case OT_GOTO_STATION: + return BaseStation::Get(this->GetDestination())->xy; + case OT_GOTO_DEPOT: - if ((o.GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) return INVALID_TILE; - return Depot::Get(o.GetDestination())->xy; + if ((this->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) return INVALID_TILE; + return (v->type == VEH_AIRCRAFT) ? Station::Get(this->GetDestination())->xy : Depot::Get(this->GetDestination())->xy; + + default: + return INVALID_TILE; } } @@ -435,8 +443,8 @@ static uint GetOrderDistance(const Order *prev, const Order *cur, const Vehicle return max(dist1, dist2); } - TileIndex prev_tile = GetOrderLocation(*prev); - TileIndex cur_tile = GetOrderLocation(*cur); + TileIndex prev_tile = prev->GetLocation(v); + TileIndex cur_tile = cur->GetLocation(v); if (prev_tile == INVALID_TILE || cur_tile == INVALID_TILE) return 0; return DistanceManhattan(prev_tile, cur_tile); } diff --git a/src/order_gui.cpp b/src/order_gui.cpp index d591bb4388..9f974f8b8c 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -996,23 +996,7 @@ public: int sel = this->GetOrderFromPt(pt.y); if (_ctrl_pressed && sel < this->vehicle->GetNumOrders()) { - const Order *ord = this->vehicle->GetOrder(sel); - TileIndex xy = INVALID_TILE; - - switch (ord->GetType()) { - case OT_GOTO_WAYPOINT: - case OT_GOTO_STATION: - xy = BaseStation::Get(ord->GetDestination())->xy; - break; - - case OT_GOTO_DEPOT: - if ((ord->GetDepotActionType() & ODATFB_NEAREST_DEPOT) != 0) break; - xy = (this->vehicle->type == VEH_AIRCRAFT) ? Station::Get(ord->GetDestination())->xy : Depot::Get(ord->GetDestination())->xy; - break; - default: - break; - } - + TileIndex xy = this->vehicle->GetOrder(sel)->GetLocation(this->vehicle); if (xy != INVALID_TILE) ScrollMainWindowToTile(xy); return; } diff --git a/src/sound.cpp b/src/sound.cpp index a0f3862976..e337b5ebc0 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -31,6 +31,9 @@ static void OpenBankFile(const char *filename) { memset(_original_sounds, 0, sizeof(_original_sounds)); + /* If there is no sound file (nosound set), don't load anything */ + if (filename == NULL) return; + FioOpenFile(SOUND_SLOT, filename); size_t pos = FioGetPos(); uint count = FioReadDword(); @@ -162,6 +165,9 @@ static void StartSound(SoundID sound_id, int panning, uint volume) const SoundEntry *sound = GetSound(sound_id); if (sound == NULL) return; + /* Empty sound? */ + if (sound->rate == 0) return; + MixerChannel *mc = MxAllocateChannel(); if (mc == NULL) return; @@ -301,6 +307,7 @@ template if (c->GetNumMissing() != 0) continue; if (best == NULL || + (best->fallback && !c->fallback) || best->valid_files < c->valid_files || (best->valid_files == c->valid_files && (best->shortname == c->shortname && best->version < c->version))) { diff --git a/src/stdafx.h b/src/stdafx.h index 38d09b5477..4ea5ddc586 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -51,6 +51,9 @@ #define UINT16_MAX (65535U) #define INT16_MAX (32767) #define INT16_MIN (-INT16_MAX - 1) + #define UINT8_MAX (255) + #define INT8_MAX (127) + #define INT8_MIN (-INT8_MAX - 1) #endif #include diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp index b6eb880b9a..1048ac09c6 100644 --- a/src/strgen/strgen.cpp +++ b/src/strgen/strgen.cpp @@ -12,6 +12,7 @@ #include "../stdafx.h" #include "../core/alloc_func.hpp" #include "../core/endian_func.hpp" +#include "../core/math_func.hpp" #include "../string_func.h" #include "../strings_type.h" #include "strgen.h" @@ -140,7 +141,7 @@ static LangString *HashFind(const char *s) #ifdef _MSC_VER # define LINE_NUM_FMT(s) "%s (%d): warning: %s (" s ")\n" #else -# define LINE_NUM_FMT(s) "%s: :%d: " s ": %s\n" +# define LINE_NUM_FMT(s) "%s:%d: " s ": %s\n" #endif static void CDECL strgen_warning(const char *s, ...) WARN_FORMAT(1, 2); @@ -397,12 +398,20 @@ static void EmitGender(char *buf, int value) * If no relative number exists, default to +0 */ if (!ParseRelNum(&buf, &argidx, &offset)) {} + const CmdStruct *cmd = _cur_pcs.cmd[argidx]; + if ((cmd->flags & C_GENDER) == 0) { + error("Command '%s' can't have a gender", cmd->cmd); + } + for (nw = 0; nw < MAX_NUM_GENDER; nw++) { words[nw] = ParseWord(&buf); if (words[nw] == NULL) break; } if (nw != _numgenders) error("Bad # of arguments for gender command"); + + assert(IsInsideBS(cmd->value, SCC_CONTROL_START, UINT8_MAX)); PutUtf8(SCC_GENDER_LIST); + PutByte(cmd->value - SCC_CONTROL_START); PutByte(TranslateArgumentIdx(argidx, offset)); EmitWordList(words, nw); } diff --git a/src/strings.cpp b/src/strings.cpp index 47bf3d2e22..e27560b53f 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -54,6 +54,7 @@ static char **_langpack_offs; static LanguagePack *_langpack; static uint _langtab_num[32]; // Offset into langpack offs static uint _langtab_start[32]; // Offset into langpack offs +static bool _keep_gender_data = false; ///< Should we retain the gender data in the current string? /** Read an int64 from the argv array. */ @@ -718,20 +719,31 @@ static char *FormatString(char *buff, const char *str, int64 *argv, uint casei, } case SCC_GENDER_LIST: { // {G 0 Der Die Das} - const char *s = GetStringPtr(argv_orig[(byte)*str++]); // contains the string that determines gender. - int gender = 0; - if (s != NULL) { - WChar c = Utf8Consume(&s); - /* Switch case is always put before genders, so remove those bits */ - if (c == SCC_SWITCH_CASE) { - /* Skip to the last (i.e. default) case */ - for (uint num = (byte)*s++; num != 0; num--) s += 3 + (s[1] << 8) + s[2]; + /* First read the meta data from the language file. */ + WChar fmt = SCC_CONTROL_START + (byte)*str++; + byte offset = (byte)*str++; - c = Utf8Consume(&s); - } - /* Does this string have a gender, if so, set it */ - if (c == SCC_GENDER_INDEX) gender = (byte)s[0]; - } + /* Now we need to figure out what text to resolve, i.e. + * what do we need to draw? So get the actual raw string + * first using the control code to get said string. */ + char input[4 + 1]; + char *p = input + Utf8Encode(input, fmt); + *p = '\0'; + + /* Now do the string formatting. */ + char buf[256]; + bool old_kgd = _keep_gender_data; + _keep_gender_data = true; + p = FormatString(buf, input, argv_orig + offset, 0, lastof(buf)); + _keep_gender_data = old_kgd; + *p = '\0'; + + /* And determine the string. */ + int gender = 0; + const char *s = buf; + WChar c = Utf8Consume(&s); + /* Does this string have a gender, if so, set it */ + if (c == SCC_GENDER_INDEX) gender = (byte)s[0]; str = ParseStringChoice(str, gender, &buff, last); break; } @@ -802,7 +814,12 @@ static char *FormatString(char *buff, const char *str, int64 *argv, uint casei, /* This sets up the gender for the string. * We just ignore this one. It's used in {G 0 Der Die Das} to determine the case. */ case SCC_GENDER_INDEX: // {GENDER 0} - str++; + if (_keep_gender_data) { + buff += Utf8Encode(buff, SCC_GENDER_INDEX); + *buff++ = *str++; + } else { + str++; + } break; case SCC_STRING: {// {STRING} diff --git a/src/table/strgen_tables.h b/src/table/strgen_tables.h index fa252c6392..40a1b7fa35 100644 --- a/src/table/strgen_tables.h +++ b/src/table/strgen_tables.h @@ -12,9 +12,10 @@ #include "../core/enum_type.hpp" enum CmdFlags { - C_NONE = 0x0, - C_DONTCOUNT = 0x1, - C_CASE = 0x2, + C_NONE = 0x0, ///< Nothing special about this command + C_DONTCOUNT = 0x1, ///< These commands aren't counted for comparison + C_CASE = 0x2, ///< These commands support cases + C_GENDER = 0x4, ///< These commands support genders }; DECLARE_ENUM_AS_BIT_SET(CmdFlags); @@ -60,15 +61,15 @@ static const CmdStruct _cmd_structs[] = { {"REV", EmitSingleChar, SCC_REVISION, 0, C_NONE}, // openttd revision string {"SHORTCARGO", EmitSingleChar, SCC_CARGO_SHORT, 2, C_NONE}, // short cargo description, only ### tons, or ### litres - {"STRING1", EmitSingleChar, SCC_STRING1, 2, C_CASE}, // included string that consumes the string id and ONE argument - {"STRING2", EmitSingleChar, SCC_STRING2, 3, C_CASE}, // included string that consumes the string id and TWO arguments - {"STRING3", EmitSingleChar, SCC_STRING3, 4, C_CASE}, // included string that consumes the string id and THREE arguments - {"STRING4", EmitSingleChar, SCC_STRING4, 5, C_CASE}, // included string that consumes the string id and FOUR arguments - {"STRING5", EmitSingleChar, SCC_STRING5, 6, C_CASE}, // included string that consumes the string id and FIVE arguments + {"STRING1", EmitSingleChar, SCC_STRING1, 2, C_CASE | C_GENDER}, // included string that consumes the string id and ONE argument + {"STRING2", EmitSingleChar, SCC_STRING2, 3, C_CASE | C_GENDER}, // included string that consumes the string id and TWO arguments + {"STRING3", EmitSingleChar, SCC_STRING3, 4, C_CASE | C_GENDER}, // included string that consumes the string id and THREE arguments + {"STRING4", EmitSingleChar, SCC_STRING4, 5, C_CASE | C_GENDER}, // included string that consumes the string id and FOUR arguments + {"STRING5", EmitSingleChar, SCC_STRING5, 6, C_CASE | C_GENDER}, // included string that consumes the string id and FIVE arguments {"STATIONFEATURES", EmitSingleChar, SCC_STATION_FEATURES, 1, C_NONE}, // station features string, icons of the features - {"INDUSTRY", EmitSingleChar, SCC_INDUSTRY_NAME, 1, C_NONE}, // industry, takes an industry # - {"CARGO", EmitSingleChar, SCC_CARGO, 2, C_NONE}, + {"INDUSTRY", EmitSingleChar, SCC_INDUSTRY_NAME, 1, C_NONE | C_GENDER}, // industry, takes an industry # + {"CARGO", EmitSingleChar, SCC_CARGO, 2, C_NONE | C_GENDER}, {"POWER", EmitSingleChar, SCC_POWER, 1, C_NONE}, {"VOLUME", EmitSingleChar, SCC_VOLUME, 1, C_NONE}, {"VOLUME_S", EmitSingleChar, SCC_VOLUME_SHORT, 1, C_NONE}, @@ -85,8 +86,8 @@ static const CmdStruct _cmd_structs[] = { {"DATE_LONG", EmitSingleChar, SCC_DATE_LONG, 1, C_NONE}, {"DATE_ISO", EmitSingleChar, SCC_DATE_ISO, 1, C_NONE}, - {"STRING", EmitSingleChar, SCC_STRING, 1, C_CASE}, - {"RAW_STRING", EmitSingleChar, SCC_RAW_STRING_POINTER, 1, C_NONE}, + {"STRING", EmitSingleChar, SCC_STRING, 1, C_CASE | C_GENDER}, + {"RAW_STRING", EmitSingleChar, SCC_RAW_STRING_POINTER, 1, C_NONE | C_GENDER}, /* Numbers */ {"COMMA", EmitSingleChar, SCC_COMMA, 1, C_NONE}, // Number with comma @@ -96,16 +97,16 @@ static const CmdStruct _cmd_structs[] = { {"CURRENCY", EmitSingleChar, SCC_CURRENCY, 1, C_NONE}, - {"WAYPOINT", EmitSingleChar, SCC_WAYPOINT_NAME, 1, C_NONE}, // waypoint name - {"STATION", EmitSingleChar, SCC_STATION_NAME, 1, C_NONE}, - {"TOWN", EmitSingleChar, SCC_TOWN_NAME, 1, C_NONE}, - {"GROUP", EmitSingleChar, SCC_GROUP_NAME, 1, C_NONE}, - {"SIGN", EmitSingleChar, SCC_SIGN_NAME, 1, C_NONE}, - {"ENGINE", EmitSingleChar, SCC_ENGINE_NAME, 1, C_NONE}, - {"VEHICLE", EmitSingleChar, SCC_VEHICLE_NAME, 1, C_NONE}, - {"COMPANY", EmitSingleChar, SCC_COMPANY_NAME, 1, C_NONE}, + {"WAYPOINT", EmitSingleChar, SCC_WAYPOINT_NAME, 1, C_NONE | C_GENDER}, // waypoint name + {"STATION", EmitSingleChar, SCC_STATION_NAME, 1, C_NONE | C_GENDER}, + {"TOWN", EmitSingleChar, SCC_TOWN_NAME, 1, C_NONE | C_GENDER}, + {"GROUP", EmitSingleChar, SCC_GROUP_NAME, 1, C_NONE | C_GENDER}, + {"SIGN", EmitSingleChar, SCC_SIGN_NAME, 1, C_NONE | C_GENDER}, + {"ENGINE", EmitSingleChar, SCC_ENGINE_NAME, 1, C_NONE | C_GENDER}, + {"VEHICLE", EmitSingleChar, SCC_VEHICLE_NAME, 1, C_NONE | C_GENDER}, + {"COMPANY", EmitSingleChar, SCC_COMPANY_NAME, 1, C_NONE | C_GENDER}, {"COMPANYNUM", EmitSingleChar, SCC_COMPANY_NUM, 1, C_NONE}, - {"PRESIDENTNAME", EmitSingleChar, SCC_PRESIDENT_NAME, 1, C_NONE}, + {"PRESIDENTNAME", EmitSingleChar, SCC_PRESIDENT_NAME, 1, C_NONE | C_GENDER}, {"", EmitSingleChar, '\n', 0, C_DONTCOUNT}, {"{", EmitSingleChar, '{', 0, C_DONTCOUNT}, diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 4cf0af4d90..f0a1d40daf 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1468,7 +1468,7 @@ uint GetVehicleCapacity(const Vehicle *v, uint16 *mail_capacity) if (!e->CanCarryCargo()) return 0; if (mail_capacity != NULL && e->type == VEH_AIRCRAFT && IsCargoInClass(v->cargo_type, CC_PASSENGERS)) { - *mail_capacity = e->u.air.mail_capacity; + *mail_capacity = GetVehicleProperty(v, PROP_AIRCRAFT_MAIL_CAPACITY, e->u.air.mail_capacity); } CargoID default_cargo = e->GetDefaultCargoType(); @@ -1483,10 +1483,10 @@ uint GetVehicleCapacity(const Vehicle *v, uint16 *mail_capacity) /* Get capacity according to property resp. CB */ uint capacity; switch (e->type) { - case VEH_TRAIN: capacity = GetVehicleProperty(v, PROP_TRAIN_CARGO_CAPACITY, e->u.rail.capacity); break; - case VEH_ROAD: capacity = GetVehicleProperty(v, PROP_ROADVEH_CARGO_CAPACITY, e->u.road.capacity); break; - case VEH_SHIP: capacity = GetVehicleProperty(v, PROP_SHIP_CARGO_CAPACITY, e->u.ship.capacity); break; - case VEH_AIRCRAFT: capacity = e->u.air.passenger_capacity; break; + case VEH_TRAIN: capacity = GetVehicleProperty(v, PROP_TRAIN_CARGO_CAPACITY, e->u.rail.capacity); break; + case VEH_ROAD: capacity = GetVehicleProperty(v, PROP_ROADVEH_CARGO_CAPACITY, e->u.road.capacity); break; + case VEH_SHIP: capacity = GetVehicleProperty(v, PROP_SHIP_CARGO_CAPACITY, e->u.ship.capacity); break; + case VEH_AIRCRAFT: capacity = GetVehicleProperty(v, PROP_AIRCRAFT_PASSENGER_CAPACITY, e->u.air.passenger_capacity); break; default: NOT_REACHED(); } @@ -1495,7 +1495,7 @@ uint GetVehicleCapacity(const Vehicle *v, uint16 *mail_capacity) if (e->type != VEH_SHIP) { if (e->type == VEH_AIRCRAFT) { if (!IsCargoInClass(v->cargo_type, CC_PASSENGERS)) { - capacity += e->u.air.mail_capacity; + capacity += GetVehicleProperty(v, PROP_AIRCRAFT_MAIL_CAPACITY, e->u.air.mail_capacity); } if (v->cargo_type == CT_MAIL) return capacity; } else { diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 9da03c1431..c559702e77 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -2043,8 +2043,15 @@ public: switch (widget) { case VVW_WIDGET_START_STOP_VEH: // start stop - DoCommandP(v->tile, v->index, 0, - _vehicle_command_translation_table[VCT_CMD_START_STOP][v->type]); + if (_ctrl_pressed) { + /* Scroll to current order destination */ + TileIndex tile = v->current_order.GetLocation(v); + if (tile != INVALID_TILE) ScrollMainWindowToTile(tile); + } else { + /* Start/Stop */ + DoCommandP(v->tile, v->index, 0, + _vehicle_command_translation_table[VCT_CMD_START_STOP][v->type]); + } break; case VVW_WIDGET_CENTER_MAIN_VIEH: {// center main view const Window *mainwindow = FindWindowById(WC_MAIN_WINDOW, 0);