Merge branch 'master' into jgrpp

# Conflicts:
#	src/base_station_base.h
#	src/industry.h
#	src/industry_cmd.cpp
#	src/industry_gui.cpp
#	src/lang/korean.txt
#	src/os/macosx/crashlog_osx.cpp
#	src/station_cmd.cpp
#	src/town.h
#	src/town_cmd.cpp
#	src/town_gui.cpp
This commit is contained in:
Jonathan G Rennison
2020-01-20 18:36:55 +00:00
39 changed files with 604 additions and 225 deletions

View File

@@ -2846,6 +2846,16 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
extern bool AfterLoadGame();
extern bool LoadOldSaveGame(const char *file);
/**
* Clear temporary data that is passed between various saveload phases.
*/
static void ResetSaveloadData()
{
ResetTempEngineData();
ResetLabelMaps();
ResetOldWaypoints();
}
/**
* Clear/free saveload state.
*/
@@ -3217,6 +3227,8 @@ static SaveOrLoadResult DoLoad(LoadFilter *reader, bool load_check)
_next_offs = 0;
if (!load_check) {
ResetSaveloadData();
/* Old maps were hardcoded to 256x256 and thus did not contain
* any mapsize information. Pre-initialize to 256x256 to not to
* confuse old games */
@@ -3322,6 +3334,8 @@ SaveOrLoadResult SaveOrLoad(const char *filename, SaveLoadOperation fop, Detaile
try {
/* Load a TTDLX or TTDPatch game */
if (fop == SLO_LOAD && dft == DFT_OLD_GAME_FILE) {
ResetSaveloadData();
InitializeGame(256, 256, true, true); // set a mapsize of 256x256 for TTDPatch games or it might get confused
/* TTD/TTO savegames have no NewGRFs, TTDP savegame have them