summaryrefslogtreecommitdiff
path: root/src/saveload
AgeCommit message (Collapse)Author
2021-03-26Fix: store the recent new game_creation settings in savegamesPatric Stout
This allows us to later on see what someone did, and makes sure that "restart" command still knows how the game was created.
2021-03-26Change: rename setting "max_heightlevel" to "map_height_limit"Patric Stout
This better reflects what it is, and hopefully removes a bit of the confusion people are having what this setting actually does. Additionally, update the text on the setting to better inform users what it is doing exactly, so they can make an educated decision on how to change it. Next commit will introduce an "auto" value, which should be the new default. The rename has as added benefit that everyone will start out on the "auto" value.
2021-03-14Change: Heading for 1.12 now (#8862)Patric Stout
2021-02-28Add: settings to limit your fast-forward game speedPatric Stout
By default this setting is set to 2500% normal game speed.
2021-02-13Codechange: Don't use cpp_offsetof in the save/load code.Michael Lutz
Many of the member variables that are used in save/load are inside types that are not standard layout types. Using pointer arithmetics to determine addresses of members inside types that are not standard layout is generally undefined behaviour. If we'd use C++17, it is conditionally supported, which means each compiler may or may not support it. And even then using it for individual array elements is syntactically not supported the the standard offsetof function. Unfortunately, the trickery employed for saving linkgraph settings causes quite some clutter in the settings ini files.
2021-02-13Codechange: Don't use cpp_offsetof in the TTO/TTD savegame loader.Michael Lutz
Many of the member variables that are used in the oldloader are inside types that are not standard layout types. Using pointer arithmetics to determine addresses of members inside types that are not standard layout is generally undefined behaviour. If we'd use C++17, it is conditionally supported, which means each compiler may or may not support it. And even then using it for individual array elements is syntactically not supported the the standard offsetof function.
2021-01-22Change: Apply some consistency to singleplayer related commentsglx22
2021-01-22Feature: Allow GameScripts to add additional text to Industry view windowdP
2021-01-18Fix #8589, 653e7fa548: Motion counter is NewGRF-visible but not saved, ↵Michael Lutz
leading to desyncs. (#8591)
2021-01-17Fix eeb88e8: Trains reversed while paused do not correctly update sprite ↵Matt Kimber
bounds (#8540)
2021-01-08Fix 2fd871e2af5: load correct ending-year for old (pre 0.7) savegamesPatric Stout
Despite what it looked like, you could never really change the ending-year (it was always reset to 2050 on start-up). See commit 683b65ee1 for details. As a side-effect, the variable that was suppose to store the ending-year was just zero, never containing a real ending-year.
2021-01-08Codechange: Remove min/max functions in favour of STL variants (#8502)Charles Pigott
2021-01-05Codechange: create MutableSpriteCache to remove the need to cast Vehicle to ↵Matt Kimber
a mutable type in render methods
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