Update to 1.10.2

This commit is contained in:
Pavel Stupnikov
2020-06-02 01:52:45 +03:00
parent c7c3966eec
commit 0e8ed94e00
828 changed files with 146109 additions and 141846 deletions
+18
View File
@@ -341,6 +341,10 @@ void NORETURN SlError(StringID string, const char *extra_msg)
* when we access them during cleaning the pool dereferences of
* those indices will be made with segmentation faults as result. */
if (_sl.action == SLA_LOAD || _sl.action == SLA_PTRS) SlNullPointers();
/* Logging could be active. */
GamelogStopAnyAction();
throw std::exception();
}
@@ -2377,6 +2381,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.
*/
@@ -2623,6 +2637,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 */
@@ -2727,6 +2743,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