Commit Graph

80 Commits (6c3a5b5b17de97be292fc9442f6bd693973114ee)

Author SHA1 Message Date
Patric Stout c98717cb45 Fix: do not add an offset to a nullptr
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.
4 years ago
dP 452e1e3328 Codechange #8258: Remove unused town cargo caches from the savegame 4 years ago
dP ca2604c4e2 Revert #8157: Redundant change 4 years ago
Jonathan G Rennison 7a09413a1a Fix: Incorrect save/load array size of Town::cargo_accepted
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.
4 years ago
Jonathan G Rennison 54237b0e98 Codechange: Move SlSkipBytes to saveload.h 4 years ago
Charles Pigott 64b1c70fdd Codechange: Add WARN_FORMAT to vseprintf and fix the cascade of warnings that followed 4 years ago
Michael Lutz 9b6f5e3bb8 Codechange: Store GS lang texts in std::strings. 4 years ago
Yexo 64278fd598 Fix: reset roadtype/streetcartype info for non-road bridges 4 years ago
glx 2f264f2c92 Change: Heading for 1.11 now 4 years ago
Johannes E. Krause 107283748a Feature: SLF_HEX to print hexadecimal numbers in the config file 4 years ago
Niels Martin Hansen 2fd871e2af Feature: Configurable game ending year
Functionally reverts 683b65ee1
5 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Jack Baron e4f08f2880 Fix: Bump savegame version 5 years ago
JMcKiern 04f659e768 Fix: Some typos found using codespell 5 years ago
peter1138 f538179878 Feature: Multi-tile docks and docking points. 5 years ago
Niels Martin Hansen 140a96b3a0 Change: Limit memory allocations for each Squirrel instance
This can avoid out-of-memory situations due to single scripts using up the entire address space.
Instead, scripts that go above the maximum are killed.
The maximum is default 1 GB per script, but can be configured by a setting.
5 years ago
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 5 years ago
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 5 years ago
Peter Nelson f6264e5212 Change: Bump savegame version for tree tile water class conversion. 5 years ago
Charles Pigott fe448a2616 Remove: OPF 5 years ago
PeterN 6c6971fb43
Add: Road vehicle path cache. (#7261) 5 years ago
PeterN dd20ccee88
Feature: Industries with neutral stations (e.g. Oil Rig) only supply/accept cargo to/from their neutral station. (#7234)
This change is a controlled by a game setting, located under Environment ->
Industries which allows toggling the behaviour. It defaults to enabled.

"Company stations can serve industries with attached neutral stations"

When enabled, industries with attached neutral station (such as Oil Rigs) may
also be served by company-owned stations built nearby. This is the traditional
behaviour.

When disabled, these industries may only be served by their neutral station.
Any nearby company-owned stations won't be able to serve them, nor will the
neutral station serve anything else other than the industry.
5 years ago
Peter Nelson b8a0107ad1 Change: Add configurable curve penalty for ships. 5 years ago
Niels Martin Hansen 52572cafa6 Add: Option for population-linear town cargo generation
Introduce a new default algorithm for town cargo generation (passengers and mail), and a game setting to choose between the new and original algorithm.

The original town cargo generation algorithm has the property of the generated amount relating to the square of each building's population, meaning large towns easily produce more cargo than can realistically be transported. The problem is excessive cargo is amplified if playing with cargodist.

The new algorithm introduced instead has a linear relation to the population. The result is that smaller towns will produce slightly more cargo, while the largest towns will produce about a fourth of what they would with the original algorithm.

Existing savegames will use the original algorithm, while new games will default to the new algorithm.
5 years ago
frosch a67ee02529
Change: Heading for 1.10 now (#7319) 5 years ago
PeterN c0c8fb25fb
Change: Use SlErrorCorrupt() on pool index error when loading a savegame, instead of terminating. (#7219) 5 years ago
Peter Nelson 64878320cc Fix #6803: CargoMonitorID bit packing updated to handle 64 cargo types.
This requires a saveload bump to change the bitpacking on loading older saves.
5 years ago
Peter Nelson 0b10678050 Change: Make ships stop in locks to move up/down instead of following the slope. 5 years ago
Peter Nelson e21ade375e Codechange: Change from numeric to descriptive SLV enum labels for last entries. 6 years ago
Peter Nelson 0f37a683a2 Codechange: Additional type safety for saveload version variables. 6 years ago
Peter Nelson 9de12521ec Codechange: Convert saveload numbers to enum values.
(This was mostly achieved with a few in-place regexes)
6 years ago
Peter Nelson ea4ea62816 Codechange: Make saveload version upper bound exclusive, i.e. version object was removed instead of version object last appeared. 6 years ago
Peter Nelson 67633606b0 Codechange: Remove value mangling and field misuse in SLE_WRITEBYTE.
The original translation functionality hasn't been used since 2007.
6 years ago
Peter Nelson 1c725fce47 Change: Add ability to save/load std::deque<> containers. 6 years ago
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 6 years ago
Charles Pigott 2aacddd412 Codechange: lengthof is not defined for runtime-length strings, use sizeof instead 6 years ago
frosch fc4c4d080c (svn r27757) -Change: Make StringID 32bit. 7 years ago
alberth 0adfb1ac6f (svn r27653) -Fix(r27647): Rename FileOperation enum and values to SaveLoadOperation to avoid nameclash with windows compiler toolkit. 8 years ago
alberth 6f201ce4a8 (svn r27651) -Codechange: Introduce methods for setting the name and title of _file_to_saveload. 8 years ago
alberth 597380e099 (svn r27650) -Codechange: Replace SaveOrLoadMode by FileOperation and DetailedFileType. 8 years ago
alberth 2fa0fdb176 (svn r27638) -Codechange: Move FiosType enum, move and rename SetFiosType function. 8 years ago
alberth 087ed1e999 (svn r27636) -Codechange: Rename FileType to AbstractFileType. 8 years ago
alberth 9135f7130e (svn r27635) -Codechange: Move FileType and FileToSaveLoad structure definitions. 8 years ago
rubidium 46792e58dd (svn r26591) -Add: some instrumentation to catch most cases where the wrong number of bytes would be written into variables during loading (or read during saving) 10 years ago
frosch b0a063ed77 (svn r25702) -Add: about 3000 years of savegame compatibility. 11 years ago
rubidium 0cc3d8df4b (svn r25258) -Codechange: save linkgraph (fonsinchen) 11 years ago
truebrain 5cda1d7c90 (svn r23603) -Add: support for control commands in strings, in both network and safe/load (Rubidium) 13 years ago
rubidium df16ebd730 (svn r23595) -Codechange: add comma after last enum to get a more uniform coding style 13 years ago
rubidium c9a7f572ec (svn r23195) -Codechange: if we really need to cast away constness, use const_cast 13 years ago
frosch 275a394bc1 (svn r22880) -Cleanup: SIZE_MAX is now defined in stdafx.h 13 years ago