diff --git a/.ottdrev-vc b/.ottdrev-vc index 7565d463ba..40abd5e45e 100644 --- a/.ottdrev-vc +++ b/.ottdrev-vc @@ -1,2 +1,2 @@ -jgrpp-0.31.2 20190617 0 7271fdda4c6aed75823b6efeab4971cfdc0e257d 1 0 -60c2f928566480ba695361b25e6181f58f54b6cd848625d0a3ba856f5a7cf898 - +jgrpp-0.31.3 20190711 0 eab5db97692c82afc11465887c9a16f698461ed4 1 0 +316e7b69e51a6cd40c766278bf4d4ffb0c833ac5466e13b1abce2f14c68ad124 - diff --git a/README.md b/README.md index a5f3f6ebac..b22b77f685 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## JGR's Patchpack version 0.31.2 +## JGR's Patchpack version 0.31.3 This is a collection of patches applied to [OpenTTD](http://www.openttd.org/) diff --git a/jgrpp-changelog.md b/jgrpp-changelog.md index 419d09ad98..9776d9be68 100644 --- a/jgrpp-changelog.md +++ b/jgrpp-changelog.md @@ -2,6 +2,15 @@ * * * +### v0.31.3 (2019-07-13) +* Fix the target order number of conditional order jumps being loaded incorrectly from SpringPP savegames. +* Fix order backups not being restored when using buy and refit. +* Fix rendering error when waypoint sign is moved. +* Fix virtual trains in the template train replacement editing window reserving a unit number. +* Re-add previously removed group collapse and expand all buttons. +* Fix compilation on MSVC. +* Bump trunk base from commit 66cd32a252ee0edab11448b560371878b2189223 to commit 21edf67f89c60351d5a0d84625455aa296b6b950. + ### v0.31.2 (2019-06-18) * Fix through load orders which use full load any cargo, with multi-cargo trains. * Fix PBS reservations not being shortened or extended when adding or removing signals to bridges/tunnels. diff --git a/src/gamelog.cpp b/src/gamelog.cpp index 46f86bcadf..8a809bd18f 100644 --- a/src/gamelog.cpp +++ b/src/gamelog.cpp @@ -65,6 +65,11 @@ void GamelogStopAction() if (print) GamelogPrintDebug(5); } +void GamelogStopActionIfStarted() +{ + if (_gamelog_action_type != GLAT_NONE) GamelogStopAction(); +} + /** * Frees the memory allocated by a gamelog */ diff --git a/src/openttd.cpp b/src/openttd.cpp index 4b4ecb132a..c5f6fc54fd 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -404,6 +404,9 @@ static void ShutdownGame() */ static void LoadIntroGame(bool load_newgrfs = true) { + Window *v; + FOR_ALL_WINDOWS_FROM_FRONT(v) delete v; + _game_mode = GM_MENU; if (load_newgrfs) ResetGRFConfig(false); diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index f81a52af2d..07c4d2c9b3 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -3496,7 +3496,9 @@ bool AfterLoadGame() /* convert wait for cargo orders to ordinary load if possible */ Order *order; FOR_ALL_ORDERS(order) { - if (order->GetLoadType() == static_cast(1)) order->SetLoadType(OLF_LOAD_IF_POSSIBLE); + if ((order->IsType(OT_GOTO_STATION) || order->IsType(OT_LOADING) || order->IsType(OT_IMPLICIT)) && order->GetLoadType() == static_cast(1)) { + order->SetLoadType(OLF_LOAD_IF_POSSIBLE); + } } } diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index 2f18bada7a..790a671499 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -2657,6 +2657,9 @@ static inline void ClearSaveLoadState() delete _sl.lf; _sl.lf = nullptr; + + extern void GamelogStopActionIfStarted(); + GamelogStopActionIfStarted(); } /** diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp index 23a10b8a98..de15910f53 100644 --- a/src/saveload/vehicle_sl.cpp +++ b/src/saveload/vehicle_sl.cpp @@ -254,7 +254,12 @@ void AfterLoadVehicles(bool part_of_load) SCOPE_INFO_FMT([&v], "AfterLoadVehicles: %s", scope_dumper().VehicleInfo(v)); FOR_ALL_VEHICLES(v) { /* Reinstate the previous pointer */ - if (v->Next() != nullptr) v->Next()->previous = v; + if (v->Next() != nullptr) { + v->Next()->previous = v; + if (HasBit(v->subtype, GVSF_VIRTUAL) != HasBit(v->Next()->subtype, GVSF_VIRTUAL)) { + SlErrorCorrupt("Mixed virtual/non-virtual vehicle consist"); + } + } if (v->NextShared() != nullptr) v->NextShared()->previous_shared = v; if (part_of_load) v->fill_percent_te_id = INVALID_TE_ID;