diff --git a/changelog.txt b/changelog.txt index b181431ff6..eb5cd6aece 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,13 @@ +1.9.1 (2019-04-08) +------------------------------------------------------------------------ +- Fix #6564: Enforce types of arguments for station name strings (#7419) +- Fix #7433: Don't use AirportSpec substitute if it's not enabled (#7435) +- Fix #7447, #7466, #7476: Missing NewGRF strings due to Action 4 feature check skipping pseudo-feature 48 (#7449) +- Fix #6222: Advanced sprite layout sometimes showed incorrect railtype ground tile. (#7460) +- Fix #7439: CompanyRemoveReason overwritten by ClientID (#7465) +- Fix: [Windows] Incorrect error handling could lead to cascading error windows (#7482) +- Fix #7478: Don't remove NewGRF objects on company take-over. (#7483) + 1.9.0 (2019-04-01) ------------------------------------------------------------------------ - Fix #7411: Use industry production callback (if used) on initial industry cargo generation (#7412) diff --git a/known-bugs.txt b/known-bugs.txt index 760f3f6465..7df6283c50 100644 --- a/known-bugs.txt +++ b/known-bugs.txt @@ -1,6 +1,6 @@ OpenTTD's known bugs -Last updated: 2019-04-01 -Release version: 1.9.0 +Last updated: 2019-04-08 +Release version: 1.9.1 ------------------------------------------------------------------------ diff --git a/os/debian/changelog b/os/debian/changelog index 8c3b0cbf90..37b3cd7814 100644 --- a/os/debian/changelog +++ b/os/debian/changelog @@ -1,3 +1,9 @@ +openttd (1.9.1-0) unstable; urgency=low + + * New upstream release 1.9.1 + + -- OpenTTD Mon, 08 Apr 2019 20:00:00 +0100 + openttd (1.9.0-0) unstable; urgency=low * New upstream release 1.9.0 diff --git a/os/os2/installer/make_installer.cmd b/os/os2/installer/make_installer.cmd index a15198b5f1..f0a8401643 100644 --- a/os/os2/installer/make_installer.cmd +++ b/os/os2/installer/make_installer.cmd @@ -1,6 +1,6 @@ @echo off -set OPENTTD_VERSION=1.9.0 +set OPENTTD_VERSION=1.9.1 set OPENSFX_VERSION=0.8.0 set NOSOUND_VERSION=0.8.0 set OPENGFX_VERSION=1.2.0 diff --git a/os/rpm/openttd.spec b/os/rpm/openttd.spec index f19907a56c..81f73543b9 100644 --- a/os/rpm/openttd.spec +++ b/os/rpm/openttd.spec @@ -17,9 +17,9 @@ # Name: openttd -Version: 1.9 +Version: 1.9.1 Release: 0 -%define srcver 1.9.0 +%define srcver 1.9.1 Summary: An open source reimplementation of Chris Sawyer's Transport Tycoon Deluxe License: GPL-2.0 Group: Amusements/Games/Strategy/Other diff --git a/os/windows/installer/install.nsi b/os/windows/installer/install.nsi index 86a07e562c..efd3310c95 100644 --- a/os/windows/installer/install.nsi +++ b/os/windows/installer/install.nsi @@ -1,8 +1,8 @@ # Version numbers to update !define APPV_MAJOR 1 !define APPV_MINOR 9 -!define APPV_MAINT 0 -!define APPV_BUILD 5 +!define APPV_MAINT 1 +!define APPV_BUILD 0 !define APPV_EXTRA "" !define APPNAME "OpenTTD" ; Define application name diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 73806da15e..bc79d943bc 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -1284,7 +1284,7 @@ struct AIDebugWindow : public Window { case WID_AID_RELOAD_TOGGLE: if (ai_debug_company == OWNER_DEITY) break; /* First kill the company of the AI, then start a new one. This should start the current AI again */ - DoCommandP(0, CCA_DELETE | ai_debug_company << 16, CRR_MANUAL, CMD_COMPANY_CTRL); + DoCommandP(0, CCA_DELETE | ai_debug_company << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL); DoCommandP(0, CCA_NEW_AI | ai_debug_company << 16, 0, CMD_COMPANY_CTRL); break; diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 651b216a56..6194ebee80 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -805,10 +805,9 @@ void CompanyAdminRemove(CompanyID company_id, CompanyRemoveReason reason) * @param flags operation to perform * @param p1 various functionality * - bits 0..15: CompanyCtrlAction - * - bits 16..24: CompanyID - * @param p2 various depending on CompanyCtrlAction - * - bits 0..31: ClientID (with CCA_NEW) - * - bits 0..1: CompanyRemoveReason (with CCA_DELETE) + * - bits 16..23: CompanyID + * - bits 24..31: CompanyRemoveReason (with CCA_DELETE) + * @param p2 ClientID * @param text unused * @return the cost of this operation or an error */ @@ -882,7 +881,7 @@ CommandCost CmdCompanyCtrl(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 } case CCA_DELETE: { // Delete a company - CompanyRemoveReason reason = (CompanyRemoveReason)GB(p2, 0, 2); + CompanyRemoveReason reason = (CompanyRemoveReason)GB(p1, 24, 8); if (reason >= CRR_END) return CMD_ERROR; Company *c = Company::GetIfValid(company_id); diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 732ace6a2b..298fd4f98d 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -836,7 +836,7 @@ DEF_CONSOLE_CMD(ConResetCompany) } /* It is safe to remove this company */ - DoCommandP(0, CCA_DELETE | index << 16, CRR_MANUAL, CMD_COMPANY_CTRL); + DoCommandP(0, CCA_DELETE | index << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL); IConsolePrint(CC_DEFAULT, "Company deleted."); return true; @@ -1213,7 +1213,7 @@ DEF_CONSOLE_CMD(ConReloadAI) } /* First kill the company of the AI, then start a new one. This should start the current AI again */ - DoCommandP(0, CCA_DELETE | company_id << 16, CRR_MANUAL, CMD_COMPANY_CTRL); + DoCommandP(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0,CMD_COMPANY_CTRL); DoCommandP(0, CCA_NEW_AI | company_id << 16, 0, CMD_COMPANY_CTRL); IConsolePrint(CC_DEFAULT, "AI reloaded."); @@ -1250,7 +1250,7 @@ DEF_CONSOLE_CMD(ConStopAI) } /* Now kill the company of the AI. */ - DoCommandP(0, CCA_DELETE | company_id << 16, CRR_MANUAL, CMD_COMPANY_CTRL); + DoCommandP(0, CCA_DELETE | company_id << 16 | CRR_MANUAL << 24, 0, CMD_COMPANY_CTRL); IConsolePrint(CC_DEFAULT, "AI stopped, company deleted."); return true; diff --git a/src/economy.cpp b/src/economy.cpp index 32c6b85862..7f9298258a 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -642,7 +642,7 @@ static void CompanyCheckBankrupt(Company *c) * that changing the current company is okay. In case of single * player we are sure (the above check) that we are not the local * company and thus we won't be moved. */ - if (!_networking || _network_server) DoCommandP(0, CCA_DELETE | (c->index << 16), CRR_BANKRUPT, CMD_COMPANY_CTRL); + if (!_networking || _network_server) DoCommandP(0, CCA_DELETE | (c->index << 16) | (CRR_BANKRUPT << 24), 0, CMD_COMPANY_CTRL); break; } } diff --git a/src/lang/croatian.txt b/src/lang/croatian.txt index f8d00dc199..261b08cd16 100644 --- a/src/lang/croatian.txt +++ b/src/lang/croatian.txt @@ -3120,7 +3120,7 @@ STR_NEWGRF_LIST_MISSING :{RED}Nedostaju STR_NEWGRF_BROKEN :{WHITE}Ponašanje NewGRF '{0:STRING}' će vjerojatno uzrokovati deharmonizaciju i/ili rušenje igre STR_NEWGRF_BROKEN_POWERED_WAGON :{WHITE}Promijenjen status motoriziranog vagona za '{1:ENGINE}' kad vozilo nije u spremištu. STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}Ovo mijenja dužinu vozila za '{1:ENGINE}' kada vozilo nije unutar spremišta -STR_NEWGRF_BROKEN_CAPACITY :{WHITE}Promijenilo je kapacitet vozila za '{1:ENGINE}' kada nije u spremšta ili se remontira +STR_NEWGRF_BROKEN_CAPACITY :{WHITE}Promijenilo je kapacitet vozila za '{1:ENGINE}' kada nije u spremištu ili se prenamjenjuje STR_BROKEN_VEHICLE_LENGTH :{WHITE}Vlak'{VEHICLE}' koji pripada tvrtci '{COMPANY}' neispravne je dužine. Uzrok problema je vjerojatno u NewGRF datotekama. Igra će se možda deharmonizirati ili srušiti STR_NEWGRF_BUGGY :{WHITE}NewGRF '{0:STRING}' daje netočne informacije @@ -3903,9 +3903,9 @@ STR_VEHICLE_DETAILS_TRAIN_ARTICULATED_RV_CAPACITY :{BLACK}Nosivost STR_REFIT_CAPTION :{WHITE}{VEHICLE} (Prenamijeni) STR_REFIT_TITLE :{GOLD}Odaberi vrstu tereta za prijevoz: STR_REFIT_NEW_CAPACITY_COST_OF_REFIT :{BLACK}Nova nosivost: {GOLD}{CARGO_LONG}{}{BLACK}Cijena prenamjene: {RED}{CURRENCY_LONG} -STR_REFIT_NEW_CAPACITY_INCOME_FROM_REFIT :{BLACK}Novi kapacitet: {GOLD}{CARGO_LONG}{}{BLACK}Prihod od remonta: {GREEN}{CURRENCY_LONG} -STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT :{BLACK}Novi kapacitet: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Trošak remonta: {RED}{CURRENCY_LONG} -STR_REFIT_NEW_CAPACITY_INCOME_FROM_AIRCRAFT_REFIT :{BLACK}Novi kapacitet: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Prihod od remonta: {GREEN}{CURRENCY_LONG} +STR_REFIT_NEW_CAPACITY_INCOME_FROM_REFIT :{BLACK}Novi kapacitet: {GOLD}{CARGO_LONG}{}{BLACK}Prihod od prenamjene: {GREEN}{CURRENCY_LONG} +STR_REFIT_NEW_CAPACITY_COST_OF_AIRCRAFT_REFIT :{BLACK}Novi kapacitet: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Cijena prenamjene: {RED}{CURRENCY_LONG} +STR_REFIT_NEW_CAPACITY_INCOME_FROM_AIRCRAFT_REFIT :{BLACK}Novi kapacitet: {GOLD}{CARGO_LONG}, {GOLD}{CARGO_LONG}{}{BLACK}Prihod od prenamjene: {GREEN}{CURRENCY_LONG} STR_REFIT_SELECT_VEHICLES_TOOLTIP :{BLACK}Odaberi vozila za remont. Povlačenje mišem dopušta odabir više vozila. Klik na prazninu će označiti cijelo vozilo. Ctrl+Klik će označiti vozilo i niz koji slijedi. STR_REFIT_TRAIN_LIST_TOOLTIP :{BLACK}Odaberi vrstu tereta koju će vlak prevoziti diff --git a/src/lang/dutch.txt b/src/lang/dutch.txt index b837036998..ad2e043dd3 100644 --- a/src/lang/dutch.txt +++ b/src/lang/dutch.txt @@ -98,7 +98,7 @@ STR_QUANTITY_NOTHING : STR_QUANTITY_PASSENGERS :{COMMA}{NBSP}passagier{P "" s} STR_QUANTITY_COAL :{WEIGHT_LONG} kolen STR_QUANTITY_MAIL :{COMMA}{NBSP}zak{P "" ken} post -STR_QUANTITY_OIL :{VOLUME_LONG} Vaten olie +STR_QUANTITY_OIL :{VOLUME_LONG} vaten olie STR_QUANTITY_LIVESTOCK :{COMMA}{NBSP}stuk{P "" s} vee STR_QUANTITY_GOODS :{COMMA}{NBSP}krat{P "" ten} goederen STR_QUANTITY_GRAIN :{WEIGHT_LONG} graan @@ -2856,7 +2856,7 @@ STR_SE_MAPGEN_FLAT_WORLD_HEIGHT_QUERY_CAPT :{WHITE}Verander # Map generation progress STR_GENERATION_WORLD :{WHITE}Bezig met wereldontwikkeling... STR_GENERATION_ABORT :{BLACK}Stop -STR_GENERATION_ABORT_CAPTION :{WHITE}Stop Wereldontwikkeling +STR_GENERATION_ABORT_CAPTION :{WHITE}Wereldontwikkeling stoppen STR_GENERATION_ABORT_MESSAGE :{YELLOW}Weet je zeker dat je de actie wilt stoppen? STR_GENERATION_PROGRESS :{WHITE}{NUM}% compleet STR_GENERATION_PROGRESS_NUM :{BLACK}{NUM} / {NUM} diff --git a/src/lang/french.txt b/src/lang/french.txt index 41755d2b40..18a6394b9f 100644 --- a/src/lang/french.txt +++ b/src/lang/french.txt @@ -3025,13 +3025,14 @@ STR_NEWGRF_LIST_MISSING :{RED}Modules ma STR_NEWGRF_BROKEN :{WHITE}Le comportement du NewGRF "{0:STRING}" peut provoquer des erreurs de synchronisation et/ou des plantages STR_NEWGRF_BROKEN_POWERED_WAGON :{WHITE}Il a modifié l'état de wagon motorisé pour "{1:ENGINE}" en dehors du dépôt STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}Il a modifié la longueur de véhicule pour "{1:ENGINE}" en dehors du dépôt -STR_NEWGRF_BROKEN_CAPACITY :{WHITE}Il a changé la capacité pour '{1:ENGINE}' hors d'un dépôt ou d'un réaménagement +STR_NEWGRF_BROKEN_CAPACITY :{WHITE}Il a changé la capacité pour "{1:ENGINE}" hors d'un dépôt ou d'un réaménagement STR_BROKEN_VEHICLE_LENGTH :{WHITE}Le train "{VEHICLE}" appartenant à "{COMPANY}" a une longueur invalide. Cela est probablement dû à des problèmes avec des NewGRFs, et peut provoquer des erreurs de synchronisation ou planter le jeu. STR_NEWGRF_BUGGY :{WHITE}Le module NewGRF "{0:STRING}" fournit une information incorrecte STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Les informations de cargaison/réaménagement pour "{1:ENGINE}" après sa construction sont différentes de celles de la liste d'achat. Cela peut causer un échec de réaménagement lors de l'auto-renouvellement/remplacement. STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}"{1:STRING}" a causé une boucle infinie dans la fonction de rappel de production -STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Callback {1:HEX} a retourné un résultat invalide {2:HEX} +STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}La fonction de rappel {1:HEX} a retourné un résultat invalide {2:HEX} +STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}"{1:STRING}" a renvoyé un type de cargaison invalide dans la fonction de rappel de production à {2:HEX} # 'User removed essential NewGRFs'-placeholders for stuff without specs STR_NEWGRF_INVALID_CARGO : diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 05fb27fc87..148a455062 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -1675,7 +1675,7 @@ static void NetworkAutoCleanCompanies() /* Is the company empty for autoclean_unprotected-months, and is there no protection? */ if (_settings_client.network.autoclean_unprotected != 0 && _network_company_states[c->index].months_empty > _settings_client.network.autoclean_unprotected && StrEmpty(_network_company_states[c->index].password)) { /* Shut the company down */ - DoCommandP(0, CCA_DELETE | c->index << 16, CRR_AUTOCLEAN, CMD_COMPANY_CTRL); + DoCommandP(0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0, CMD_COMPANY_CTRL); IConsolePrintF(CC_DEFAULT, "Auto-cleaned company #%d with no password", c->index + 1); } /* Is the company empty for autoclean_protected-months, and there is a protection? */ @@ -1689,7 +1689,7 @@ static void NetworkAutoCleanCompanies() /* Is the company empty for autoclean_novehicles-months, and has no vehicles? */ if (_settings_client.network.autoclean_novehicles != 0 && _network_company_states[c->index].months_empty > _settings_client.network.autoclean_novehicles && vehicles_in_company[c->index] == 0) { /* Shut the company down */ - DoCommandP(0, CCA_DELETE | c->index << 16, CRR_AUTOCLEAN, CMD_COMPANY_CTRL); + DoCommandP(0, CCA_DELETE | c->index << 16 | CRR_AUTOCLEAN << 24, 0, CMD_COMPANY_CTRL); IConsolePrintF(CC_DEFAULT, "Auto-cleaned company #%d with no vehicles", c->index + 1); } } else { diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 2fc546d4eb..9ec93e7e11 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -5688,7 +5688,7 @@ static void FeatureNewName(ByteReader *buf) bool new_scheme = _cur.grffile->grf_version >= 7; uint8 feature = buf->ReadByte(); - if (feature >= GSF_END) { + if (feature >= GSF_END && feature != 0x48) { grfmsg(1, "FeatureNewName: Unsupported feature 0x%02X, skipping", feature); return; } diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp index 6213097bd0..d0621f60e6 100644 --- a/src/newgrf_airport.cpp +++ b/src/newgrf_airport.cpp @@ -100,6 +100,7 @@ AirportSpec AirportSpec::specs[NUM_AIRPORTS]; ///< Airport specifications. assert(type < lengthof(AirportSpec::specs)); const AirportSpec *as = &AirportSpec::specs[type]; if (type >= NEW_AIRPORT_OFFSET && !as->enabled) { + if (_airport_mngr.GetGRFID(type) == 0) return as; byte subst_id = _airport_mngr.GetSubstituteID(type); if (subst_id == AT_INVALID) return as; as = &AirportSpec::specs[subst_id]; diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 9f03813dfb..88aa645dd3 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -772,9 +772,10 @@ static void ChangeTileOwner_Object(TileIndex tile, Owner old_owner, Owner new_ow bool do_clear = false; - if (IsObjectType(tile, OBJECT_OWNED_LAND) && new_owner != INVALID_OWNER) { + ObjectType type = GetObjectType(tile); + if ((type == OBJECT_OWNED_LAND || type >= NEW_OBJECT_OFFSET) && new_owner != INVALID_OWNER) { SetTileOwner(tile, new_owner); - } else if (IsObjectType(tile, OBJECT_STATUE)) { + } else if (type == OBJECT_STATUE) { Town *t = Object::GetByTile(tile)->town; ClrBit(t->statues, old_owner); if (new_owner != INVALID_OWNER && !HasBit(t->statues, new_owner)) { diff --git a/src/os/windows/ottdres.rc.in b/src/os/windows/ottdres.rc.in index ebf0cc4afb..6aa7ce216c 100644 --- a/src/os/windows/ottdres.rc.in +++ b/src/os/windows/ottdres.rc.in @@ -79,8 +79,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,9,0,!!ISODATE!! - PRODUCTVERSION 1,9,0,!!ISODATE!! + FILEVERSION 1,9,1,!!ISODATE!! + PRODUCTVERSION 1,9,1,!!ISODATE!! FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp index 4a49555492..e0a29b67ee 100644 --- a/src/os/windows/win32.cpp +++ b/src/os/windows/win32.cpp @@ -78,7 +78,7 @@ bool LoadLibraryList(Function proc[], const char *dll) void ShowOSErrorBox(const char *buf, bool system) { MyShowCursor(true); - MessageBox(GetActiveWindow(), OTTD2FS(buf), _T("Error!"), MB_ICONSTOP); + MessageBox(GetActiveWindow(), OTTD2FS(buf), _T("Error!"), MB_ICONSTOP | MB_TASKMODAL); } void OSOpenBrowser(const char *url) diff --git a/src/rev.cpp b/src/rev.cpp index 26c66f1507..cbc3013e88 100644 --- a/src/rev.cpp +++ b/src/rev.cpp @@ -37,7 +37,7 @@ bool IsReleasedVersion() * * shows a "M", if the binary is made from modified source code. */ -const char _openttd_revision[] = "1.9.0"; +const char _openttd_revision[] = "1.9.1"; /** * The text version of OpenTTD's build date. @@ -50,7 +50,7 @@ const char _openttd_build_date[] = __DATE__ " " __TIME__; /** * The git revision hash of this version. */ -const char _openttd_revision_hash[] = "0b340fd3769fe6623d89a682959d957b5dfa0aef"; +const char _openttd_revision_hash[] = "b61ef7e0d2e11e6f8fa963c9459e918b24afc8b5"; /** * Let us know if current build was modified. This detection @@ -82,11 +82,11 @@ const byte _openttd_revision_tagged = 1; * final release will always have a lower version number than the released * version, thus making comparisons on specific revisions easy. */ -const uint32 _openttd_newgrf_version = 1 << 28 | 9 << 24 | 0 << 20 | 1 << 19 | 28004; +const uint32 _openttd_newgrf_version = 1 << 28 | 9 << 24 | 1 << 20 | 1 << 19 | 28004; #ifdef __MORPHOS__ /** * Variable used by MorphOS to show the version. */ -extern const char morphos_versions_tag[] = "$VER: OpenTTD 1.9.0 (01.04.19) OpenTTD Team [MorphOS, PowerPC]"; +extern const char morphos_versions_tag[] = "$VER: OpenTTD 1.9.1 (08.04.19) OpenTTD Team [MorphOS, PowerPC]"; #endif diff --git a/src/rev.cpp.in b/src/rev.cpp.in index 2d58bb152d..e77fee48ac 100644 --- a/src/rev.cpp.in +++ b/src/rev.cpp.in @@ -82,7 +82,7 @@ const byte _openttd_revision_tagged = !!ISTAG!!; * final release will always have a lower version number than the released * version, thus making comparisons on specific revisions easy. */ -const uint32 _openttd_newgrf_version = 1 << 28 | 9 << 24 | 0 << 20 | !!ISSTABLETAG!! << 19 | 28004; +const uint32 _openttd_newgrf_version = 1 << 28 | 9 << 24 | 1 << 20 | !!ISSTABLETAG!! << 19 | 28004; #ifdef __MORPHOS__ /** diff --git a/src/script/api/ai_changelog.hpp b/src/script/api/ai_changelog.hpp index 0afe4e08c4..f9db78c280 100644 --- a/src/script/api/ai_changelog.hpp +++ b/src/script/api/ai_changelog.hpp @@ -17,7 +17,6 @@ * * \b 1.9.0 * - * 1.9.0 is not yet released. The following changes are not set in stone yet. * API additions: * \li AIAirport::GetMonthlyMaintenanceCost * \li AIGroup::SetParent diff --git a/src/script/api/game_changelog.hpp b/src/script/api/game_changelog.hpp index 094449d73b..b74f65deb5 100644 --- a/src/script/api/game_changelog.hpp +++ b/src/script/api/game_changelog.hpp @@ -17,7 +17,6 @@ * * \b 1.9.0 * - * 1.9.0 is not yet released. The following changes are not set in stone yet. * API additions: * \li GSAirport::GetMonthlyMaintenanceCost * \li GSClient diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index e6864d70db..947630f0f7 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2639,21 +2639,29 @@ bool SplitGroundSpriteForOverlay(const TileInfo *ti, SpriteID *ground, RailTrack bool snow_desert; switch (*ground) { case SPR_RAIL_TRACK_X: + case SPR_MONO_TRACK_X: + case SPR_MGLV_TRACK_X: snow_desert = false; *overlay_offset = RTO_X; break; case SPR_RAIL_TRACK_Y: + case SPR_MONO_TRACK_Y: + case SPR_MGLV_TRACK_Y: snow_desert = false; *overlay_offset = RTO_Y; break; case SPR_RAIL_TRACK_X_SNOW: + case SPR_MONO_TRACK_X_SNOW: + case SPR_MGLV_TRACK_X_SNOW: snow_desert = true; *overlay_offset = RTO_X; break; case SPR_RAIL_TRACK_Y_SNOW: + case SPR_MONO_TRACK_Y_SNOW: + case SPR_MGLV_TRACK_Y_SNOW: snow_desert = true; *overlay_offset = RTO_Y; break; diff --git a/src/strings.cpp b/src/strings.cpp index a3ece9830e..6ffa688f1d 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -78,7 +78,10 @@ int64 StringParameters::GetInt64(WChar type) return 0; } if (this->type != NULL) { - assert(this->type[this->offset] == 0 || this->type[this->offset] == type); + if (this->type[this->offset] != 0 && this->type[this->offset] != type) { + DEBUG(misc, 0, "Trying to read string parameter with wrong type"); + return 0; + } this->type[this->offset] = type; } return this->data[this->offset++]; @@ -1416,8 +1419,9 @@ static char *FormatString(char *buff, const char *str_arg, StringParameters *arg } } - int64 args_array[] = {STR_TOWN_NAME, st->town->index, st->index}; - StringParameters tmp_params(args_array); + uint64 args_array[] = {STR_TOWN_NAME, st->town->index, st->index}; + WChar types_array[] = {0, SCC_TOWN_NAME, SCC_NUM}; + StringParameters tmp_params(args_array, 3, types_array); buff = GetStringWithArgs(buff, str, &tmp_params, last); } break; diff --git a/src/table/sprites.h b/src/table/sprites.h index da3bc76271..a573269975 100644 --- a/src/table/sprites.h +++ b/src/table/sprites.h @@ -402,8 +402,11 @@ static const SpriteID SPR_MONO_SINGLE_SOUTH = 1090; static const SpriteID SPR_MONO_SINGLE_EAST = 1091; static const SpriteID SPR_MONO_SINGLE_WEST = 1092; static const SpriteID SPR_MONO_TRACK_Y = 1093; +static const SpriteID SPR_MONO_TRACK_X = 1094; static const SpriteID SPR_MONO_TRACK_BASE = 1100; static const SpriteID SPR_MONO_TRACK_N_S = 1117; +static const SpriteID SPR_MONO_TRACK_Y_SNOW = 1119; +static const SpriteID SPR_MONO_TRACK_X_SNOW = 1120; static const SpriteID SPR_MGLV_SINGLE_X = 1169; static const SpriteID SPR_MGLV_SINGLE_Y = 1170; static const SpriteID SPR_MGLV_SINGLE_NORTH = 1171; @@ -411,7 +414,10 @@ static const SpriteID SPR_MGLV_SINGLE_SOUTH = 1172; static const SpriteID SPR_MGLV_SINGLE_EAST = 1173; static const SpriteID SPR_MGLV_SINGLE_WEST = 1174; static const SpriteID SPR_MGLV_TRACK_Y = 1175; +static const SpriteID SPR_MGLV_TRACK_X = 1176; static const SpriteID SPR_MGLV_TRACK_BASE = 1182; +static const SpriteID SPR_MGLV_TRACK_Y_SNOW = 1184; +static const SpriteID SPR_MGLV_TRACK_X_SNOW = 1185; static const SpriteID SPR_MGLV_TRACK_N_S = 1199; static const SpriteID SPR_WAYPOINT_X_1 = SPR_OPENTTD_BASE + 78; static const SpriteID SPR_WAYPOINT_X_2 = SPR_OPENTTD_BASE + 79;