Merge 1.10.0-RC1

This commit is contained in:
dP
2020-02-18 20:56:38 +03:00
204 changed files with 3153 additions and 1064 deletions

View File

@@ -227,6 +227,13 @@ void UpdateAllVirtCoords()
RebuildViewportKdtree();
}
void ClearAllCachedNames()
{
ClearAllStationCachedNames();
ClearAllTownCachedNames();
ClearAllIndustryCachedNames();
}
/**
* Initialization of the windows and several kinds of caches.
* This is not done directly in AfterLoadGame because these
@@ -243,6 +250,7 @@ static void InitializeWindowsAndCaches()
SetupColoursAndInitialWindow();
/* Update coordinates of the signs. */
ClearAllCachedNames();
UpdateAllVirtCoords();
ResetViewportAfterLoadGame();
@@ -791,6 +799,15 @@ bool AfterLoadGame()
_settings_game.linkgraph.distribution_default = DT_MANUAL;
}
if (IsSavegameVersionBefore(SLV_105)) {
extern int32 _old_ending_year_slv_105; // in date.cpp
_settings_game.game_creation.ending_year = _old_ending_year_slv_105 - 1;
} else if (IsSavegameVersionBefore(SLV_ENDING_YEAR)) {
/* Ending year was a GUI setting before SLV_105, was removed in revision 683b65ee1 (svn r14755). */
/* This also converts scenarios, both when loading them into the editor, and when starting a new game. */
_settings_game.game_creation.ending_year = DEF_END_YEAR;
}
/* Load the sprites */
GfxLoadSprites();
LoadStringWidthTable();
@@ -2998,6 +3015,16 @@ bool AfterLoadGame()
}
}
if (IsSavegameVersionBefore(SLV_190)) {
for (Order *order : Order::Iterate()) {
order->SetTravelTimetabled(order->GetTravelTime() > 0);
order->SetWaitTimetabled(order->GetWaitTime() > 0);
}
for (OrderList *orderlist : OrderList::Iterate()) {
orderlist->RecalculateTimetableDuration();
}
}
/*
* Only keep order-backups for network clients (and when replaying).
* If we are a network server or not networking, then we just loaded a previously