Merge branch 'jgrpp' into jgrpp-nrt

This commit is contained in:
Jonathan G Rennison
2019-07-13 20:35:17 +01:00
8 changed files with 32 additions and 5 deletions

View File

@@ -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
*/

View File

@@ -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);

View File

@@ -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<OrderLoadFlags>(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<OrderLoadFlags>(1)) {
order->SetLoadType(OLF_LOAD_IF_POSSIBLE);
}
}
}

View File

@@ -2657,6 +2657,9 @@ static inline void ClearSaveLoadState()
delete _sl.lf;
_sl.lf = nullptr;
extern void GamelogStopActionIfStarted();
GamelogStopActionIfStarted();
}
/**

View File

@@ -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;