summaryrefslogtreecommitdiff
path: root/src/saveload
AgeCommit message (Collapse)Author
2021-01-01Codechange: move some DEBUG-levels and remove some others in saveload ↵Patric Stout
routine (#8474) When running with -dsl=2 it is very easy to miss important information as there was a lot of noise in between too. This tunes the debug levels a bit to be less noisy while keeping the important bits.
2020-12-27Codechange: Use std::string in file scanners.Michael Lutz
2020-12-27Codechange: Even more std::string usage in file IO.Michael Lutz
2020-12-27Codechange: Convert some more FIO functions to take std::string.Michael Lutz
2020-12-27Codechange: Replace assert_compile macro with static_assertCharles Pigott
2020-12-27Cleanup: Remove unused ChunkType flag CH_AUTO_LENGTHcirdan
CH_AUTO_LENGTH is no longer used anywhere, so remove all code that depends on it.
2020-12-27Cleanup: Remove save-only autolength flag from economy chunk handlerscirdan
CH_AUTO_LENGTH is only used when saving chunks; it makes no sense to set it for chunks without a save handler.
2020-12-27Codechange: Replace FOR_VEHICLE_ORDERS with range-based for loopsglx22
2020-12-22Change: [Linkgraph] Pause the game when linkgraph jobs lag (#6470)Jonathan G Rennison
Check if the job is still running two date fract ticks before it is due to join, and if so pause the game until its done. When loading a game, check if the game would block immediately due to a job which is scheduled to be joined within two date fract ticks, and if so pause the game until its done. This avoids the main thread being blocked on a thread join, which appears to the user as if the game is unresponsive, as the UI does not repaint and cannot be interacted with. Show if pause is due to link graph job in status bar, update network messages. This does not apply for network clients.
2020-12-22Feature: Set exclusive access to industry from GS (#8115)Pavel Stupnikov
2020-12-22Feature: Influence industry production changes from GS (#7912)Niels Martin Hansen
2020-12-22Fix: next 67 savegame versions are used in PatchPacks; skip them (#8411)Patric Stout
Various of PatchPacks (Spring 2013, Joker, ChillPP) used versions slightly higher than ours. Of course, as time went by, this caught up with us, and we are now almost pushing a new version that would conflict with them. To avoid users creating unneeded issues about "why can I not load my savegame", lets be ahead of the curve and flat-out refuse to load them. Version-wise, this is totally fine. We have ~32k versions to go before we run out (0x8000 is masked by JGRPP; we should avoid using that). At the rate we bump savegames, this is not going to happen in any sane reality.
2020-12-15Add: support for emscripten (play-OpenTTD-in-the-browser)Patric Stout
Emscripten compiles to WASM, which can be loaded via HTML / JavaScript. This allows you to play OpenTTD inside a browser. Co-authored-by: milek7 <me@milek7.pl>
2020-12-15Codechange: Make use of the improved C++17 emplace_back function.Michael Lutz
2020-12-06Codechange: don't do work GetVariableAddress() is already doingPatric Stout
2020-12-06Fix: do not add an offset to a nullptrPatric Stout
This is, by specs, undefined behaviour. See https://reviews.llvm.org/D67122 In cases where this is done, optimizations done by LLVM can generate code that causes crashes. GetVariableAddress() had two (legit) ways this could happen: - For SaveLoad set to global - For SaveLoad set to SLE_VAR_NULL, where sld->address is always a nullptr, and object could or could not be a nullptr.
2020-12-06Fix 63ccb36ef3: Crash trying to load TTO/TTD savegames. (#8356)Michael Lutz
2020-07-27Codechange #8258: Remove unused town cargo caches from the savegamedP
2020-07-27Codechange: Spell 'Viewport' consistentlyTechGeekNZ
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'. This patch makes everything consistent.
2020-06-28Change #8159: Remove now unused town cargo caches without bumping the ↵dP
savegame version
2020-06-28Revert #8157: Redundant changedP
2020-06-28Fix: Incorrect save/load array size of Town::cargo_acceptedJonathan G Rennison
In 11ab3c4e the number of cargo types was changed from 32 to 64. The save/load of Town::cargo_accepted was not updated, such that only half of the data structure is saved/loaded in savegame versions 199 to 218. Discard and regenerate data from all savegame versions prior to 219.
2020-06-28Codechange: Move SlSkipBytes to saveload.hJonathan G Rennison
2020-06-27Codechange: Add WARN_FORMAT to vseprintf and fix the cascade of warnings ↵Charles Pigott
that followed
2020-06-22Fix 63ccb36e: Incorrect string type for OrderBackup::name save/loadJonathan G Rennison
In 63ccb36e BaseConsist::name was changed from a malloced char* to a std::string. OrderBackup inherits from BaseConsist. The saveload of OrderBackup::name was not updated.
2020-06-05Add: introduce CMake for project managementPatric Stout
CMake works on all our supported platforms, like MSVC, Mingw, GCC, Clang, and many more. It allows for a single way of doing things, so no longer we need shell scripts and vbs scripts to work on all our supported platforms. Additionally, CMake allows to generate project files for like MSVC, KDevelop, etc. This heavily reduces the lines of code we need to support multiple platforms from a project perspective. Addtiionally, this heavily improves our detection of libraries, etc.
2020-05-21Codechange: Use std::string for most of the user-settable custom names.Michael Lutz
2020-05-21Codechange: Store GS lang texts in std::strings.Michael Lutz
2020-05-12Fix #8142, 5aa6351: Buoy owner and tile owner can be different (#8143)glx22
2020-05-10Fix #8132: Corrupted savegame crashing OpenTTD on loadglx
2020-05-10Fix: Stop any gamelog action when recovering from SlError()glx
2020-05-06Fix #8021: limit savegame range for docking tiles fixingglx
2020-05-06Fix: reset roadtype/streetcartype info for non-road bridgesYexo
2020-05-04Fix #8108: always update tile_hash after updating v->tileYexo
2020-05-04Fix c01a2e2: crash on loading old savegames with invalid animated tile ↵SamuXarick
information
2020-05-04Fix #8108: possible crash on loading TTD savegames with phantom oil rigsSamuXarick
2020-03-30Fix #8020: Add missing docking tiles around industry neutral stationsSamuXarick
2020-02-19Fix #8011, f5381798: Dock tile in TTD savegame was only 2 bytesglx
2020-02-08Change: Heading for 1.11 nowglx
2020-02-06Feature: SLF_HEX to print hexadecimal numbers in the config fileJohannes E. Krause
2020-01-12Codechange: Cache resolved town, station and industry name stringsJonathan G Rennison
2020-01-12Fix #7925: Reset temporary saveload data at the start of loading a savegame ↵frosch
instead of at the end. Otherwise temporary data may be passed from an aborted load action to the next load action.
2020-01-05Fix: When loading old timetabled saves, also reset cached timetable durationCharles Pigott
2020-01-05Fix #7587: Crash when loading saves with waypoints with invalid locationsCharles Pigott
2019-12-28Feature: Configurable game ending yearNiels Martin Hansen
Functionally reverts 683b65ee1
2019-12-21Codechange: Replace FOR_ALL_TOWNS with range-based for loopsglx
2019-12-21Codechange: Replace FOR_ALL_SUBSIDIES with range-based for loopsglx
2019-12-21Codechange: Replace story related FOR_ALL with range-based for loopsglx
2019-12-21Codechange: Replace FOR_ALL_SIGNS with range-based for loopsglx
2019-12-21Codechange: Replace FOR_ALL_ROADSTOPS with range-based for loopsglx