Jonathan G Rennison
77d3be3d3b
Fix loading of gamelog revision text in upstream savegame loader
3 years ago
Jonathan G Rennison
3d0b1a3b12
Fix loading of gamelog change items from savegame ver >= 294
...
See: https://github.com/OpenTTD/OpenTTD/issues/9740
3 years ago
Jonathan G Rennison
2d71ec1c5a
Bump savegame for object ground types
3 years ago
Jonathan G Rennison
0691b25e17
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/saveload/afterload.cpp
3 years ago
Charles Pigott
cf16f452da
Fix #9680 : Recalculating aircraft positions before map array updates caused crashes ( #9699 )
3 years ago
Jonathan G Rennison
74bfe4e6d2
Allow placing routing restrictions on tunnel/bridge entrance/exit signals
...
No reserve through support
3 years ago
Jonathan G Rennison
3308edf792
Try to extend reservation when passing sighting distance of non-end signal
3 years ago
Jonathan G Rennison
3d4261a33a
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/order_cmd.cpp
# src/table/settings/news_display_settings.ini
3 years ago
Dmitry Erlikh
33ef34189e
Fix #9648 : add missing commas in crash message
3 years ago
Jonathan G Rennison
486e69f1f8
Fix use of optional from wrong namespace
3 years ago
Jonathan G Rennison
9e946d4c5d
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/command.cpp
# src/console_cmds.cpp
# src/group_gui.cpp
# src/lang/catalan.txt
# src/lang/czech.txt
# src/lang/danish.txt
# src/lang/greek.txt
# src/lang/hungarian.txt
# src/lang/irish.txt
# src/lang/japanese.txt
# src/lang/luxembourgish.txt
# src/lang/norwegian_bokmal.txt
# src/lang/romanian.txt
# src/lang/russian.txt
# src/lang/serbian.txt
# src/lang/simplified_chinese.txt
# src/lang/slovak.txt
# src/lang/spanish_MX.txt
# src/lang/swedish.txt
# src/lang/tamil.txt
# src/lang/traditional_chinese.txt
# src/lang/turkish.txt
# src/lang/ukrainian.txt
# src/lang/vietnamese.txt
# src/network/network.cpp
# src/network/network_client.cpp
# src/network/network_func.h
# src/network/network_internal.h
# src/network/network_server.cpp
# src/network/network_server.h
# src/saveload/afterload.cpp
# src/saveload/newgrf_sl.cpp
# src/saveload/saveload.h
# src/script/script_instance.cpp
# src/toolbar_gui.cpp
# src/toolbar_gui.h
# src/vehicle_gui.cpp
# src/widgets/rail_widget.h
# src/widgets/vehicle_widget.h
# src/window.cpp
3 years ago
Jonathan G Rennison
3cff5e53e4
Add train cached_curve_speed_mod to VENC, cache checks and debug window
3 years ago
Jonathan G Rennison
faf32200cf
Merge tag '12.0-beta1' into jgrpp-beta
...
# Conflicts:
# CMakeLists.txt
# bin/ai/CMakeLists.txt
# bin/game/CMakeLists.txt
# src/build_vehicle_gui.cpp
# src/console_cmds.cpp
# src/core/overflowsafe_type.hpp
# src/fios.cpp
# src/lang/english.txt
# src/lang/german.txt
# src/lang/korean.txt
# src/lang/polish.txt
# src/network/core/game_info.cpp
# src/network/core/game_info.h
# src/network/core/tcp_game.cpp
# src/network/core/tcp_game.h
# src/network/network.cpp
# src/network/network_client.cpp
# src/network/network_client.h
# src/network/network_coordinator.cpp
# src/network/network_gui.cpp
# src/network/network_server.cpp
# src/network/network_server.h
# src/newgrf_engine.cpp
# src/openttd.cpp
# src/rev.cpp.in
# src/settings_type.h
# src/train.h
# src/train_cmd.cpp
3 years ago
Jonathan G Rennison
f764fcfb1f
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/console_cmds.cpp
# src/debug.cpp
# src/lang/vietnamese.txt
# src/network/core/address.cpp
# src/network/core/address.h
# src/network/core/config.h
# src/network/core/os_abstraction.cpp
# src/network/core/os_abstraction.h
# src/network/core/tcp_listen.h
# src/network/core/udp.cpp
# src/network/core/udp.h
# src/network/network.cpp
# src/network/network_client.cpp
# src/network/network_gamelist.cpp
# src/network/network_server.cpp
# src/network/network_udp.cpp
# src/newgrf.cpp
# src/openttd.cpp
# src/saveload/saveload.h
# src/settings.cpp
# src/settings_table.cpp
# src/settings_type.h
# src/table/settings/network_settings.ini
3 years ago
Jonathan G Rennison
62afd94b47
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/company_cmd.cpp
# src/economy.cpp
# src/lang/swedish.txt
# src/network/network_command.cpp
# src/news_gui.cpp
# src/saveload/saveload.h
# src/script/api/script_list.cpp
# src/video/cocoa/cocoa_v.mm
# src/video/sdl2_v.cpp
3 years ago
Jonathan G Rennison
d1f1a6942a
Add support for loading trunk savegames versions 293 - 299 (12.0)
...
Use modified upstream saveload implementation for these versions
Re-arrange headers to support multiple saveload implementations
3 years ago
SamuXarick
0563c0e308
Fix #9591 : Update station docking tiles upon placing a water object on a docking tile ( #9594 )
...
(cherry picked from commit e404d16929
)
3 years ago
Loïc Guilloux
a84feb3444
Fix 39e90ec: Integers for scripts are 64bit, but saved as 32bit ( #9415 )
...
(cherry picked from commit ddafc0de05
)
3 years ago
Jonathan G Rennison
fb8020916a
Add upstream savegame version fields
3 years ago
Jonathan G Rennison
5ec1573ccd
Add separate max load savegame version, set savegame version values
3 years ago
Jonathan G Rennison
61cc60099a
Merge branch 'jgrpp' into jgrpp-beta
...
# Conflicts:
# src/network/core/packet.cpp
# src/network/core/udp.cpp
3 years ago
Jonathan G Rennison
6ba53a9a68
Add ifdef around 32 bit length limit check in SlSetLength
3 years ago
Jonathan G Rennison
81290df946
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/lang/spanish.txt
# src/network/core/tcp_content_type.h
# src/network/network_content.cpp
# src/saveload/cheat_sl.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/saveload/station_sl.cpp
# src/saveload/vehicle_sl.cpp
# src/settings.cpp
# src/settings_internal.h
# src/table/settings.h.preamble
# src/table/settings/company_settings.ini
# src/table/settings/currency_settings.ini
# src/table/settings/gameopt_settings.ini
# src/table/settings/misc_settings.ini
# src/table/settings/settings.ini
# src/table/settings/win32_settings.ini
# src/table/settings/window_settings.ini
3 years ago
Jonathan G Rennison
53139c2405
Add current day/month to tracerestrict and conditional order conditionals
3 years ago
Jonathan G Rennison
ffef1c9e44
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/saveload/cargopacket_sl.cpp
# src/saveload/cheat_sl.cpp
# src/saveload/company_sl.cpp
# src/saveload/engine_sl.cpp
# src/saveload/map_sl.cpp
# src/saveload/order_sl.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/saveload/station_sl.cpp
# src/saveload/vehicle_sl.cpp
# src/settings.cpp
# src/settings_gui.cpp
# src/settings_internal.h
# src/stdafx.h
# src/table/settings/settings.ini
# src/town_cmd.cpp
# src/vehicle.cpp
3 years ago
Jonathan G Rennison
ec8512e2ea
When declining to buy a company, ask the next company immediately
3 years ago
Loïc Guilloux
f2c03a77f0
Change: Don't store not to be activated newGRFs in savegames ( #9627 )
3 years ago
Jonathan G Rennison
544da99102
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/cargopacket.h
# src/lang/korean.txt
# src/linkgraph/linkgraph.h
# src/linkgraph/linkgraphjob.h
# src/linkgraph/linkgraphschedule.h
# src/network/network_admin.h
# src/network/network_func.h
# src/network/network_server.cpp
# src/network/network_server.h
# src/order_base.h
# src/rail_cmd.cpp
# src/saveload/company_sl.cpp
# src/saveload/depot_sl.cpp
# src/saveload/economy_sl.cpp
# src/saveload/linkgraph_sl.cpp
# src/saveload/map_sl.cpp
# src/saveload/newgrf_sl.cpp
# src/saveload/order_sl.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/saveload/signs_sl.cpp
# src/saveload/station_sl.cpp
# src/saveload/subsidy_sl.cpp
# src/saveload/town_sl.cpp
# src/saveload/vehicle_sl.cpp
# src/script/api/script_object.cpp
# src/settings.cpp
# src/string.cpp
# src/string_func.h
# src/table/CMakeLists.txt
# src/table/settings/settings.ini
# src/viewport_sprite_sorter_sse4.cpp
3 years ago
Jonathan G Rennison
784fcbd1e7
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/settings.cpp
# src/settings_gui.cpp
# src/settings_internal.h
# src/table/currency_settings.ini
# src/table/gameopt_settings.ini
# src/table/misc_settings.ini
# src/table/settings.h.preamble
3 years ago
Jonathan G Rennison
b00d5e07d2
Fix fb0549ea: Incorrect cherry-pick removed end marker
3 years ago
Jonathan G Rennison
781aaa4fe5
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# src/settings.cpp
# src/settings_gui.cpp
# src/settings_internal.h
# src/table/company_settings.ini
# src/table/currency_settings.ini
# src/table/gameopt_settings.ini
# src/table/misc_settings.ini
# src/table/settings.h.preamble
# src/table/settings.ini
# src/table/win32_settings.ini
# src/table/window_settings.ini
3 years ago
Tyler Trahan
fb0549ea59
Feature: Configurable subsidy duration
...
(cherry picked from commit d09210e1c6
)
3 years ago
Jonathan G Rennison
4042480806
Merge branch 'jgrpp' into jgrpp-beta
...
# Conflicts:
# src/settings.cpp
# src/settings_gui.cpp
# src/settings_internal.h
# src/table/company_settings.ini
# src/table/currency_settings.ini
# src/table/gameopt_settings.ini
# src/table/misc_settings.ini
# src/table/settings.h.preamble
# src/table/settings.ini
# src/table/win32_settings.ini
# src/table/window_settings.ini
3 years ago
Patric Stout
573ab48e9c
Fix 81062163: for (really) old games, station bus/truck station cache was not updated ( #9366 )
...
(cherry picked from commit 1e432fbd71
)
3 years ago
Patric Stout
3411203e5d
Fix: compatible NewGRFs in crash-log reported wrong md5 ( #9340 )
...
The text suggests it reports the original md5, but it does in fact
report the replaced md5. Now it reports both.
(cherry picked from commit f997eb6ca4
)
3 years ago
Jonathan G Rennison
6f16655e6e
Add "special events" log. Add console command, include in crash logs.
3 years ago
Jonathan G Rennison
2e022d5194
Move game events to new event_logs header/cpp files
3 years ago
Jonathan G Rennison
c99eaf72b7
Fix #9591 : Update station docking tiles upon placing a water object on a docking tile ( #9594 )
...
See: https://github.com/OpenTTD/OpenTTD/issues/9591
See: https://github.com/OpenTTD/OpenTTD/pull/9594
Non-extended savegame bump to be applied later
(cherry picked from commit e404d16929
)
# Conflicts:
# src/object_cmd.cpp
# src/saveload/afterload.cpp
# src/saveload/saveload.h
3 years ago
SamuXarick
e404d16929
Fix #9591 : Update station docking tiles upon placing a water object on a docking tile ( #9594 )
3 years ago
Jonathan G Rennison
96ea775b24
Avoid undefined behaviour in saveload chunk handlers
...
Use data() instead of &[0] to avoid issues with empty vectors
3 years ago
Jonathan G Rennison
fd605e3cf3
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# .github/workflows/commit-checker.yml
# src/company_cmd.cpp
# src/console_cmds.cpp
# src/crashlog.cpp
# src/lang/english.txt
# src/lang/german.txt
# src/lang/indonesian.txt
# src/lang/japanese.txt
# src/lang/korean.txt
# src/lang/swedish.txt
# src/linkgraph/linkgraphjob.cpp
# src/linkgraph/mcf.cpp
# src/network/core/tcp.cpp
# src/network/core/tcp.h
# src/network/core/tcp_game.h
# src/network/core/udp.h
# src/network/network.cpp
# src/network/network_admin.cpp
# src/network/network_admin.h
# src/network/network_chat_gui.cpp
# src/network/network_client.cpp
# src/network/network_client.h
# src/network/network_func.h
# src/network/network_internal.h
# src/network/network_server.cpp
# src/network/network_server.h
# src/newgrf.cpp
# src/newgrf_station.cpp
# src/order_gui.cpp
# src/rail_cmd.cpp
# src/saveload/saveload.cpp
# src/settings.cpp
# src/settings_gui.cpp
# src/settings_internal.h
# src/settings_type.h
# src/station_cmd.cpp
# src/stdafx.h
# src/table/currency_settings.ini
# src/table/misc_settings.ini
# src/table/settings.h.preamble
# src/table/settings.ini
# src/terraform_cmd.cpp
# src/timetable_gui.cpp
# src/train_cmd.cpp
# src/tree_cmd.cpp
# src/water_cmd.cpp
3 years ago
Loïc Guilloux
38a64eb2aa
Change: Allow all tiles around docks to be docking tiles ( #9578 )
3 years ago
Patric Stout
394c749b6b
Change: Heading for 13 now ( #9573 )
3 years ago
Jonathan G Rennison
0b0d154788
Merge branch 'master' into jgrpp-beta
...
# Conflicts:
# .github/workflows/ci-build.yml
# src/lang/german.txt
# src/lang/romanian.txt
# src/lang/slovak.txt
# src/lang/turkish.txt
# src/network/core/address.cpp
# src/network/core/tcp.h
# src/network/core/udp.cpp
# src/network/network.cpp
# src/network/network_client.cpp
# src/network/network_server.cpp
# src/network/network_server.h
# src/network/network_udp.cpp
# src/openttd.cpp
# src/saveload/newgrf_sl.cpp
# src/tree_cmd.cpp
# src/video/video_driver.hpp
# src/window.cpp
# src/window_gui.h
3 years ago
Jonathan G Rennison
0dcb04f450
Fix #320 : Misspelling of SLXI chunk name
3 years ago
Jonathan G Rennison
e7480620af
Include liblzma error code in message
3 years ago
Jonathan G Rennison
54e2d1b851
Log SLXI version label at level sl=2
3 years ago
Jonathan G Rennison
0748d540e8
Implement improved breakdown speed reductions for ships
3 years ago
Jonathan G Rennison
5d351a14d2
Add new signal type: no-entry signal
...
This is only passable in one direction, but does not have a signal
or show an aspect in the opposite direction
Add a setting for whether this is shown in the signal UI.
Off by default.
3 years ago
Jonathan G Rennison
16f2ef227b
Store tunnel/bridge signal spacing on tile, adjust spacing to fit length
3 years ago
Jonathan G Rennison
b2ef6c0de8
Add implementation of multi-aspect signalling and GRF support
...
Requires realistic braking
See: #247
3 years ago
Jonathan G Rennison
13603cb8e1
Block signals into blocks with junctions now default to red with realistic braking
3 years ago
Nicolas Chappe
977604ef08
Feature: [Linkgraph] Prioritize faster routes for passengers, mail and express cargo
...
Passengers usually prefer fast paths to short paths.
Average travel times of links are updated in real-time for use in Dijkstra's algorithm,
and newer travel times weigh more, just like capacities.
3 years ago
Jonathan G Rennison
b8d5113c5a
Tracerestrict: Add slot action mode, try to acquire (only on reserve)
3 years ago
Jonathan G Rennison
71dfd2900a
Add depot order flag for specific depot
...
Use upper half of order flags for extra depot flags
See: #302
3 years ago
Jonathan G Rennison
6a009686c9
Fix #299 : Add estimated max speed (full) to template windows
3 years ago
Jonathan G Rennison
4174fe727c
Add NewGRF feature: Extra station name strings
...
These are used when all the default names have been used up,
instead of "Town Station #NNN".
3 years ago
Loïc Guilloux
460991ecf4
Feature: Persistant rotation of numbered auto/netsave after restart ( #9397 )
...
It was always starting from 0 on openttd restart.
Now the most recent auto/netsave number will be used as a base to generate the next filename.
3 years ago
Rubidium
ede3f79475
Codechange: use the name string in SaveLoad for the name of the Setting as well
3 years ago
Rubidium
01139d3368
Codechange: access the name of a setting via an accessor function
3 years ago
Rubidium
94881f5a34
Codechange: name a few unnamed settings as to not to have to check for that being empty
3 years ago
Stephan
a70aa5df49
Add #9188 : netsave now keeps multiple version around, similar to autosave ( #9395 )
3 years ago
Patric Stout
8f5d0ecde3
Codechange: split settings.ini over several files ( #9421 )
...
This reduced the load on compilers, as currently for example MacOS
doesn't like the huge settings-tables.
Additionally, nobody can find settings, as the list is massive and
unordered. By splitting it, it becomes a little bit more sensible.
3 years ago
Patric Stout
c1f13e0372
Fix: reduce the amount of debug messages on -dsl=2 ( #9420 )
...
LoadCheck makes it sound like something is really broken while
loading savegames, while it really is perfectly normal, as most
chunks do not implement LoadCheck.
3 years ago
glx22
7bcc7e11ff
Codechange: Use a common sub-class for NewGRFMapping chunks
3 years ago
glx22
6e627f35ac
Cleanup: Remove now unneeded ChunkHandler members
3 years ago
glx22
2c941cd8b3
Codechange: Use ChunkHandlers sub-classes
3 years ago
glx22
c1a9fe6fbd
Codechange: Use static array of references to ChunkHandler
3 years ago
glx22
f371a5ad70
Codechange: Preparation for ChunkHandler subclassing
3 years ago
Rubidium
7e7a4aad72
Codechange: split off the settings saveload code from the main settings handling logic
3 years ago
Loïc Guilloux
ddafc0de05
Fix 39e90ec: Integers for scripts are 64bit, but saved as 32bit ( #9415 )
3 years ago
Jonathan G Rennison
158608442c
Merge pull request #281 from VacuumBreather/train_speed_adaptation
...
# Conflicts:
# src/saveload/extended_ver_sl.cpp
# src/saveload/extended_ver_sl.h
3 years ago
Jonathan G Rennison
9edc13b889
Make sure setting set correctly on loading existing saves
3 years ago
Loïc Guilloux
0fa2007560
Fix cdb3dd049: GOAL chunk was not using the header for loading ( #9409 )
3 years ago
Patric Stout
3e3049fd0e
Codechange: make savegame-version checks more obvious in SlCompanyLiveries::Load
...
num_liveries indirectly contained the same information, but this
makes reading these things pretty difficult. So use IsSavegameVersionBefore()
like everywhere else instead.
3 years ago
Patric Stout
4e645ce749
Codechange: using "until" in function names can be confusing
...
IsSavegameVersionUntil() did a [0, N] check, not [0, N) as the
name suggests.
Until can be a confusing word, where people consider it to be
including the upperbound. Dictionary states it means "before",
excluding the upperbound. There are long debates about who is right.
So, simply remove away from this ambiguity, and call it "before"
and "before or at". This makes the world easier for everyone.
3 years ago
Patric Stout
1ed2405907
Cleanup: remove SLE_NULL and friends
...
We no longer need them. If you want to remove a field .. just
remove it! Because of the headers in the savegame, on loading,
it will do the right thing and skip the field.
Do remember to bump the savegame version, as otherwise older
clients can still load the game, but will reset the field you
have removed .. that might be unintentially.
3 years ago
Patric Stout
3826703bc3
Add: store headers for chunks with SL_STRUCTLIST
3 years ago
Patric Stout
cdb3dd0493
Add: store headers for most savegame chunks
...
When a header is added, the chunk changes from CH_ARRAY type to
CH_TABLE type.
3 years ago
Patric Stout
7dd5fd6ed4
Feature: framework to make savegames self-descriptive
...
We won't be able to make it fully self-descriptive (looking at you
MAP-chunks), but anything else can. With this framework, we can
add headers for each chunk explaining how each chunk looks like
in detail.
They also will all be tables, making it a lot easier to read in
external tooling, and opening the way to consider a database
(like SQLite) to use as savegame format.
Lastly, with the headers in the savegame, you can freely add
fields without needing a savegame version bump; older versions
of OpenTTD will simply ignore the new field. This also means
we can remove all the SLE_CONDNULL, as they are irrelevant.
The next few commits will start using this framework.
3 years ago
Jonathan G Rennison
0f73fe765f
Merge pull request #293 from VacuumBreather/station_cargo_history
...
Add station cargo history
3 years ago
Jonathan G Rennison
b438380a1e
Add station cargo history save/load support
3 years ago
Jonathan G Rennison
5698507d0b
Change station cargo history storage format
...
Use uint16 to avoid truncation issues
Don't reserve memory for unused cargoes
Store history as ring buffer
Update history graph immediately on storage date
Show total waiting cargo
3 years ago
Jonathan G Rennison
c4a596b756
Fix missing file from fb0403dc
3 years ago
Jonathan G Rennison
fb0403dcee
Add save/load support for train speed adaptation
3 years ago
Jonathan G Rennison
4d0cda12bd
Fix saving one byte at a time in Save_SPRG
3 years ago
rubidium42
f7f1d530b8
Codechange: instead of "naked" initializer lists, declare the type in the saveload macros
...
This to help variant's constructor to be able to resolve the constructor of the setting
3 years ago
Andreas Schmitt
9b1783809d
Add station cargo history
3 years ago
Andreas Schmitt
e1214a6d8b
Fix some type conversion warnings
3 years ago
Jonathan G Rennison
3e66ffead0
Saveload: Allow threaded saves in network server mode
3 years ago
Jonathan G Rennison
87948d8029
Thread: Adjust checks for whether current thread is the game thread
3 years ago
Rubidium
281a65b3e1
Cleanup: simplify some boolean expressions
3 years ago
Rubidium
357af686dc
Cleanup: use true/false instead of 1/0 where applicable
3 years ago
Patric Stout
8e91527251
Codechange: mark chunks that are not stored as CH_READONLY
...
This makes it easier to spot chunks that have a save_proc that
is a nullptr, but also prevents confusion, where it looks like
the CH_ type of a chunk has influence on how it is being read.
It is not, it is only used for saving.
3 years ago
Patric Stout
4c4b55ecbd
Change: rework GLOG chunk to be more like the rest
...
Basically it is very similar to Vehicles, where there first is
a type field, followed by data of that type. So this commit makes
it looks like how Vehicles solved that.
This removes a lot of custom "keeping track of length" stuff.
3 years ago
Patric Stout
88edfd4ef1
Change: rework several CH_RIFF chunks to use CH_ARRAY instead
...
This adds two byte extra to those chunks, and might feel a bit
silly at first. But in later changes we will prefix CH_ARRAY with
a table header, and then this change shines.
Without this, we could still add headers to these chunks, but any
external reader wouldn't know if the CH_RIFF has them or not. This
way is much more practical, as they are now more like any other
chunk.
3 years ago
Patric Stout
b9ab9e4d05
Codechange: add the ability to save/load a std::vector
...
std::vector<bool> is not possible, as .. that is a nice special
case in C++.
This new type will be used in next commit.
3 years ago
Patric Stout
97b94bdc9a
Change: prefix SL_ARR with the length of the array
...
This means that during loading we can validate that what is saved
is also that what is expected. Additionally, this makes all list
types similar to how they are stored on disk:
First a gamma to indicate length, followed by the data.
The size still depends on the type.
3 years ago
Patric Stout
f67af5cbe5
Codechange: make it more obvious SlArray supports SLE_VAR_NULL
...
In the end, the code was already doing the right thing, but a few
functions deep, and not really obvious. When validating what objects
can handle SLE_VAR_NULL, it is nicer to just have this obvious.
3 years ago
Patric Stout
d5cda58158
Codechange: use SL_NULL if you want to store null-bytes or load to nothing
...
Using SL_ARR for this gives us a bit of trouble later on, where we
add a length-field to SL_ARR. This of course is not the intention
of SLE_CONDNULL. So better seperate it.
3 years ago
Patric Stout
0d2e3437e3
Change: switch SL_DEQUE and SL_REFLIST length field to a gamma
...
The current SaveLoad is a bit inconsistent how long a length field
is. Sometimes it is a 32bit, sometimes a gamma. Make it consistent
across the board by making them all gammas.
3 years ago
Patric Stout
75e7451151
Change: indicate in the savegame if a SL_STRUCT contains any data
...
This helps external tooling to understand if a SL_STRUCT should
be skipped when reading. Basically, this transforms an SL_STRUCT
into a SL_STRUCTLIST with either 0 or 1 length.
3 years ago
Patric Stout
a146bcfe93
Change: store length of SL_STRUCTLIST in the savegame
...
This wasn't consistently done, and often variables were used that
were read by an earlier blob. By moving it next to the struct
itself, the code becomes a bit more self-contained and easier to
read.
Additionally, this allows for external tooling to know how many
structs to expect, instead of having to know where to find the
length-field or a hard-coded value that can change at any moment.
3 years ago
Patric Stout
7b135a8269
Codechange: use SLE_STRUCT(LIST) for Linkgraph chunks
3 years ago
Patric Stout
5cd0c65787
Codechange: move Save/Load functions of same chunk next to each other
3 years ago
Patric Stout
af3aba7a88
Codechange: use SLE_STRUCT(LIST) for GameScript chunks
3 years ago
Patric Stout
aa02bf27f6
Codechange: use as much of STNN code for STNS as possible
...
There was a lot of code duplication for no real reason. Now with
SLEG_STRUCT support, we can just re-use the code, hopefully making
it easier for future-us to make changes to this, without breaking
everything for old games.
3 years ago
Patric Stout
0bdca02bdf
Codechange: use SLE_STRUCT(LIST) for Station chunks
3 years ago
Patric Stout
af43fc3d62
Codechange: use SLE_STRUCT(LIST) for Company chunks
3 years ago
Patric Stout
0bb1d2fa8e
Codechange: use SLE_STRUCT(LIST) for Town chunks
3 years ago
Patric Stout
4e4720f217
Codechange: remove the special station/vehicle code from SaveLoad
...
With the new SLEG_STRUCT it is much easier to embed a struct
in a struct, where the sub-struct has limitations on when it is
being used.
This makes both the code easier to read (less magic) and avoids
the SaveLoad needing to know all these things about Stations
and Vehicles.
3 years ago
Patric Stout
4600d289b5
Codechange: ability to store structs and list of structs in savegames
...
The commits following this will use this new functionality.
Currently, a few places do this manually. This has as drawback that
the Save() and Load() code need to be in sync, and that any change
can result in (old) savegames no longer loading. In general, it is
annoying code to maintain.
By putting everything in a description table, and use that for
both Save() and Load(), it becomes easier to see what is going on,
and hopefully less likely for people to make mistakes.
3 years ago
Patric Stout
1e432fbd71
Fix 81062163: for (really) old games, station bus/truck station cache was not updated ( #9366 )
3 years ago
rubidium42
55a11710a6
Codechange: convert printf DEBUG statements to fmt Debug statements
3 years ago
Jonathan G Rennison
1002c6d9d2
Fix various compiler warnings
...
See: #267
3 years ago
Tyler Trahan
d09210e1c6
Feature: Configurable subsidy duration
3 years ago
Patric Stout
174952440a
Codechange: rework CHTS-chunk save/load to be more like the others
3 years ago
Patric Stout
8f323855b1
Codechange: rename SL_LST to SL_REFLIST to highlight the "reference" part
...
You can easily mistake SlList / SL_LST to be a list of SL_VAR, but
it is a list of SL_REF. With this rename, it hopefully saves a few
people from "wtf?" moments.
3 years ago
Patric Stout
aa6443d57a
Codechange: refactor SlList to use SlStorageHelper
3 years ago
Patric Stout
23857af693
Codechange: refactor SlDequeueHelper to work with unsigned and be more generic
...
Future additions will start using it for std::list too.
3 years ago
Patric Stout
a2147d437e
Codechange: use wrappers to get Var[Mem|File]Type, instead of GB()
3 years ago
Patric Stout
fba86f711f
Codechange: move GetVariableAddress inside SlObjectMember
...
Also move it to static, as nobody else is using it.
3 years ago
Patric Stout
f997eb6ca4
Fix: compatible NewGRFs in crash-log reported wrong md5 ( #9340 )
...
The text suggests it reports the original md5, but it does in fact
report the replaced md5. Now it reports both.
3 years ago
Patric Stout
1e564b333f
Codechange: make [Save|Load]Settings() behave more like other Save/Load code ( #9335 )
...
Prepare the full description and send it to SlObject. This does
require some code to be able to read to a SLE_VAR_NULL, like strings
etc, as there is no way to know their length beforehand.
3 years ago
Patric Stout
7572603c9d
Codechange: remove the unused SLF_HEX flag
3 years ago
Patric Stout
648ee88a02
Codechange: merge guiflags and flags in settings .ini files
...
It was rather confusing which one was for what, especially as some
SaveLoad flags were settings-only. Clean up this mess a bit by
having only Setting flags.
3 years ago
Patric Stout
264991dfa5
Codechange: move SLF_NO_NETWORK_SYNC into settings
...
It is a settings-only flag, so don't pollute SaveLoad code with it.
3 years ago
Patric Stout
414e12d26b
Codechange: move SLF_NOT_IN_SAVE into settings
...
It is a settings-only flag, so don't pollute SaveLoad code with it.
3 years ago
glx22
c27afdf3f6
Codechange: Remove FOR_ALL_CHUNK_HANDLERS
...
Co-Authored-By: Patric Stout <truebrain@openttd.org>
3 years ago
Patric Stout
28e90769f7
Codechange: use "[[maybe_unused]]" instead of a wide variety of other ways we had
...
While at it, replace OTTD_ASSERT with WITH_ASSERT, as this
is always set if assert() is valid. No matter if NDEBUG is set
or not.
3 years ago
Patric Stout
9fff00ba20
Codechange: C++-ify lists for SaveLoad ( #9323 )
...
Basically, this changes "SaveLoad *" to either:
1) "SaveLoadTable" if a list of SaveLoads was meant
2) "SaveLoad &" if a single entry was meant
As added bonus, this removes SL_END / SLE_END / SLEG_END. This
also adds core/span.hpp, a "std::span"-lite.
3 years ago
Patric Stout
0c96884700
Codechange: add a wrapper function to find all settings based on prefix ( #9312 )
3 years ago
Patric Stout
ca9a7df752
Codechange: rename str_validate to StrMakeValid(InPlace) ( #9304 )
...
This to be more explicit the function changes the value, and not
returns yes/no.
3 years ago
rubidium42
3bb6ce8827
Codechange: use initializer_lists for the settings tables
...
Not using vectors as those require copying from the initializer list and that
makes unique_ptrs to the actual SettingDesc objects later impossible.
3 years ago
rubidium42
425d50372f
Codechange: let SettingDesc extend SettingDescBase
3 years ago
Jonathan G Rennison
0579c8755c
Add tracerestrict action: No PBS signal back PF penalty
3 years ago
Jonathan G Rennison
6d3a1935a0
Fix "(undefined string)" message when SlError called when saving
3 years ago
Jonathan G Rennison
3ecda2b735
Fix handling of SlError when called from game thread
3 years ago
Jonathan G Rennison
a15e26f369
NewGRF: Elide unmasked vehicle callbacks where possible
...
This includes:
* CBID_VEHICLE_32DAY_CALLBACK
* CBID_VEHICLE_REFIT_COST
* CBID_VEHICLE_MODIFY_PROPERTY
This is on a per-property basis
The main benefit of this is to avoid callbacks not handled by the
vehicle's current sprite group from using the full graphics chain as
the "default" branch in the callback switch.
In the case where the graphics chain is long/expensive, a lot of work
had to be done before a callback failure result was eventually returned.
3 years ago
rubidium42
44ca7d9377
Change: Use gender-neutral pronouns
3 years ago
rubidium42
ddaedaf32a
Fix: empty undocumented branches
3 years ago
Rubidium
bb9121dbd4
Fix: comparison of narrow type to wide type in loop (potential for infinite loops)
3 years ago
PeterN
66cac92028
Fix #9202 : Invalid test for unset NewGRF override mapping. ( #9226 )
...
(cherry picked from commit 3d9436bd75
)
3 years ago
PeterN
f52da3de3a
Codechange: Don't save unused NewGRF override mappings. ( #9202 )
...
(cherry picked from commit 69e5da0b54
)
3 years ago
William Davis
879de9781b
Change: Use gender-neutral pronouns in console command messages (and comments) ( #9203 )
...
(cherry picked from commit 881e1da51d
)
3 years ago
Jonathan G Rennison
2e28bc8e6a
Tracerestrict: Add engine class conditional
3 years ago
rubidium42
0f062b3882
Codechange: clean up C-string support from settings
3 years ago
rubidium42
a032714dc4
Codechange: move script settings to std::string
3 years ago
rubidium42
95386dc2b8
Codechange: move misc settings to std::string
3 years ago
glx22
38c97e1492
Codechange: Replace TILE_AREA_LOOP with range-based for loops
3 years ago
Patric Stout
b136e65cf9
Change: reworked the debug levels for network facility ( #9251 )
...
It now follows very simple rules:
0 - Fatal, user should know about this
1 - Error, but we are recovering
2 - Warning, wrong but okay if you don't know
3 - Info, information you might care about
4 -
5 - Debug #1 - High level debug messages
6 - Debug #2 - Low level debug messages
7 - Trace information
3 years ago
PeterN
3d9436bd75
Fix #9202 : Invalid test for unset NewGRF override mapping. ( #9226 )
3 years ago
PeterN
69e5da0b54
Codechange: Don't save unused NewGRF override mappings. ( #9202 )
3 years ago
William Davis
881e1da51d
Change: Use gender-neutral pronouns in console command messages (and comments) ( #9203 )
3 years ago
glx22
8333323090
Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops
...
(cherry picked from commit 2feb801e56
)
3 years ago
PeterN
43fe7463ba
Fix: Update text effect size when font zoom is changed. ( #9174 )
...
(cherry picked from commit 18651dd8b1
)
3 years ago
Loïc Guilloux
88bc7bd235
Fix: [MinGW] Set minimum OS version to Windows XP ( #9135 )
...
(cherry picked from commit 356bbbb90a
)
3 years ago
Jonathan G Rennison
95ca147445
Add cheat: town local authority ratings fixed as Outstanding
3 years ago
Jonathan G Rennison
a9515456cb
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/network/core/os_abstraction.h
# src/network/core/tcp_content.h
# src/network/core/udp.cpp
# src/table/currency_settings.ini
# src/table/settings.h.preamble
3 years ago
glx22
2feb801e56
Codechange: Replace FOR_ALL_ROADTRAMTYPES with range-based for loops
3 years ago
PeterN
18651dd8b1
Fix: Update text effect size when font zoom is changed. ( #9174 )
3 years ago
Loïc Guilloux
356bbbb90a
Fix: [MinGW] Set minimum OS version to Windows XP ( #9135 )
3 years ago
Jonathan G Rennison
253772e9af
Merge branch 'master' into jgrpp
...
# Conflicts:
# CMakeLists.txt
# COMPILING.md
# src/console.cpp
# src/console_cmds.cpp
# src/console_internal.h
# src/rev.cpp.in
3 years ago
Jonathan G Rennison
ba418f9d0d
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/lang/simplified_chinese.txt
# src/network/core/tcp_content.cpp
# src/network/core/udp.cpp
# src/network/network_server.cpp
# src/saveload/linkgraph_sl.cpp
# src/table/gameopt_settings.ini
3 years ago
peter1138
a05bc04b63
Feature: Per-group wagon removal flag.
3 years ago
peter1138
27a956ba62
Codechange: Replace Group::replace_protection with Group::flags
3 years ago
Jonathan G Rennison
14636d2512
Check multi-tile ID-translated houses after house ID limit change
...
(Or when reloading NewGRFs)
If an overriding house type which newly fit in the limit changed the
tile layout, existing houses on the map could have the wrong layout
See: #243
3 years ago
Jonathan G Rennison
6a3e87114a
Add a min_version parameter to SlXvIsFeatureMissing
3 years ago
Milek7
aade177d79
Fix: Corrupted savegame could cause heap corruption by writing outside link graph edge matrix. ( #9046 )
4 years ago
Milek7
da55286c2c
Fix: Corrupted savegame could crash the game by providing invalid gamelog enums. ( #9045 )
4 years ago
Jonathan G Rennison
b514d29db1
Replace TrainCache::cached_tilt with a flags field
4 years ago
Jonathan G Rennison
cb5c6902db
Fix order dest refcount mismatch warning when loading very old savegames
4 years ago
Jonathan G Rennison
9e3ac646fa
Fix desync warning messages when loading game with non-matching train braking model
4 years ago
Jonathan G Rennison
e623560120
Fix 4c2e42fa: Wrong town caches when loading pre more-houses savegame
4 years ago
Jonathan G Rennison
7faa279250
Fix 26a123b7: Wrong variable size in VENC chunk saver
4 years ago
Jonathan G Rennison
6c62bce1ac
Bump water flooding savegame version and clear states on load
4 years ago
Jonathan G Rennison
737b538492
Bump savegame version, copy town to city multipliers for old savegames
4 years ago
Jonathan G Rennison
d7b23733b3
Bump realistic braking savegame version
4 years ago
Jonathan G Rennison
5d88030feb
Merge pull request #238 from reldred/newhouses_limits_tweaks
...
Extra House IDs
4 years ago
Jonathan G Rennison
4c2e42fae0
Add savegame conversion and version bump for more house IDs
4 years ago
Jonathan G Rennison
f1cab62140
Add cheat to fix station ratings at 100%
4 years ago
Jonathan G Rennison
f39b6f4ba3
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/cheat_gui.cpp
# src/genworld_gui.cpp
# src/landscape.cpp
# src/lang/english.txt
# src/saveload/afterload.cpp
# src/screenshot.cpp
# src/settings_gui.cpp
# src/settings_internal.h
# src/settings_type.h
# src/table/settings.ini
# src/tile_type.h
# src/widgets/genworld_widget.h
4 years ago
Jonathan G Rennison
5e14b54a0c
Merge branch 'master' into jgrpp
4 years ago
Jonathan G Rennison
26a123b708
Realistic braking: Cache offset of centre of mass of train
4 years ago
Jonathan G Rennison
912c62d749
Add timetable lateness/earliness conditional order
4 years ago
Patric Stout
13a5264438
Fix: store the recent new game_creation settings in savegames
...
This allows us to later on see what someone did, and makes sure
that "restart" command still knows how the game was created.
4 years ago
Patric Stout
1a1049bc0d
Change: rename setting "max_heightlevel" to "map_height_limit"
...
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.
4 years ago
Jonathan G Rennison
a670e369db
Add setting for no vehicles introduced after given year
4 years ago
Patric Stout
9bfa7198fd
Change: Heading for 1.12 now ( #8862 )
4 years ago
Jonathan G Rennison
4361a6dbf4
Avoid undefined behaviour const_casting std::string c_str()
...
Use non-const data() instead
See: #224
4 years ago
Jonathan G Rennison
a7ed477185
Log savegame compression format used at debug level sl 3
4 years ago
Jonathan G Rennison
edeced8fce
Zstd: Enable zstd for autosaves
...
See also: https://github.com/OpenTTD/OpenTTD/pull/8773
4 years ago
Jonathan G Rennison
c2ae7580e0
Zstd: Use zstd for network joins if supported at both ends
...
See also: https://github.com/OpenTTD/OpenTTD/pull/8773
4 years ago
Jonathan G Rennison
922e8554de
Zstd: Fix infinite loop when input exhausted
4 years ago
Jonathan G Rennison
ee7f5ad44f
Zstd: Indentation fixes
4 years ago
dP
b284d34277
Add: Support Zstandard(zstd) savegame compression
...
(cherry picked from commit 6f0aeaf2c5436550c93205e704624957e9abc969)
4 years ago
Patric Stout
f183ded9fe
Add: settings to limit your fast-forward game speed
...
By default this setting is set to 2500% normal game speed.
(cherry picked from commit c3dc27e37e
)
# Conflicts:
# src/gfx.cpp
# src/gfx_func.h
# src/settings_type.h
# src/video/cocoa/cocoa_v.mm
# src/video/video_driver.cpp
# src/video/win32_v.cpp
4 years ago
Patric Stout
c3dc27e37e
Add: settings to limit your fast-forward game speed
...
By default this setting is set to 2500% normal game speed.
4 years ago
Jonathan G Rennison
c37beb78ee
Check for broken custom bridge head states, and bump save version
4 years ago
Jonathan G Rennison
2e20da40ed
Cache current value of snow line height
4 years ago
Jonathan G Rennison
f595696e97
Add map bit to suppress water flooding checks
...
Set if all neighbour tiles are also water
This reduces the overhead of flood checks on large maps
4 years ago
Michael Lutz
7845434270
Codechange: Don't use cpp_offsetof in the save/load code.
...
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.
4 years ago
Michael Lutz
9c9292949f
Codechange: Don't use cpp_offsetof in the TTO/TTD savegame loader.
...
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.
4 years ago
Jonathan G Rennison
aff89b61f5
Add tracerestrict reserved tiles ahead conditional
4 years ago
Jonathan G Rennison
35d720b0ad
Add tracerestrict PBS end signal conditional
...
This is for realistic braking long reserve
4 years ago
Jonathan G Rennison
a0e9baac54
Bump more_cond_orders savegame version due to 8a814bbf
4 years ago
Jonathan G Rennison
d42ad99688
Add conditional order for current time/date
4 years ago
Jonathan G Rennison
650d5e014e
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/ai/ai_gui.cpp
# src/company_cmd.cpp
# src/lang/estonian.txt
# src/lang/german.txt
# src/lang/hungarian.txt
# src/lang/korean.txt
# src/lang/slovak.txt
# src/main_gui.cpp
# src/video/sdl2_v.cpp
4 years ago
Jonathan G Rennison
7154f8859d
Merge tag '1.11.0-beta1' into jgrpp
...
# Conflicts:
# src/console_cmds.cpp
# src/gfx_func.h
# src/industry.h
# src/lang/czech.txt
# src/lang/estonian.txt
# src/lang/german.txt
# src/lang/indonesian.txt
# src/lang/japanese.txt
# src/lang/norwegian_bokmal.txt
# src/lang/russian.txt
# src/lang/slovak.txt
# src/saveload/saveload.h
# src/station_gui.cpp
# src/town_gui.cpp
# src/vehicle_gui.cpp
# src/video/sdl2_v.cpp
# src/waypoint_gui.cpp
4 years ago
Jonathan G Rennison
b7ddd486cf
Merge branch 'master' into jgrpp
...
# Conflicts:
# cmake/CompileFlags.cmake
# src/aircraft_cmd.cpp
# src/blitter/32bpp_anim.cpp
# src/cargopacket.cpp
# src/cheat_gui.cpp
# src/company_cmd.cpp
# src/company_gui.cpp
# src/core/pool_func.hpp
# src/date.cpp
# src/economy.cpp
# src/error_gui.cpp
# src/ground_vehicle.cpp
# src/ground_vehicle.hpp
# src/group_gui.cpp
# src/industry_cmd.cpp
# src/lang/dutch.txt
# src/lang/french.txt
# src/lang/german.txt
# src/linkgraph/linkgraph_gui.cpp
# src/linkgraph/mcf.cpp
# src/network/network_content.cpp
# src/network/network_server.cpp
# src/network/network_udp.cpp
# src/newgrf_engine.cpp
# src/newgrf_station.cpp
# src/order_cmd.cpp
# src/order_gui.cpp
# src/pathfinder/follow_track.hpp
# src/pathfinder/yapf/yapf_common.hpp
# src/saveload/saveload.cpp
# src/settings_gui.cpp
# src/station_cmd.cpp
# src/station_kdtree.h
# src/string_func.h
# src/table/settings.ini
# src/tgp.cpp
# src/timetable_cmd.cpp
# src/timetable_gui.cpp
# src/toolbar_gui.cpp
# src/town_cmd.cpp
# src/train_cmd.cpp
# src/train_gui.cpp
# src/tree_gui.cpp
# src/tunnelbridge_cmd.cpp
# src/vehicle.cpp
# src/vehicle_gui.cpp
# src/video/sdl2_v.cpp
# src/video/sdl_v.cpp
# src/video/win32_v.cpp
# src/viewport.cpp
# src/viewport_sprite_sorter_sse4.cpp
# src/window.cpp
4 years ago
Jonathan G Rennison
d978ffcb59
Fix train braking model not being set to original on load
4 years ago
Jonathan G Rennison
6c3e5642f8
Merge branch 'master' into jgrpp
...
# Conflicts:
# cmake/CompileFlags.cmake
# src/crashlog.cpp
# src/fileio.cpp
# src/fileio_func.h
# src/fios_gui.cpp
# src/ini_load.cpp
# src/ini_type.h
# src/lang/english.txt
# src/lang/german.txt
# src/lang/korean.txt
# src/network/network_client.cpp
# src/order_base.h
# src/order_cmd.cpp
# src/os/windows/win32.cpp
# src/road_cmd.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/settings.cpp
# src/station_cmd.cpp
# src/stdafx.h
# src/table/settings.ini
# src/tree_cmd.cpp
# src/tree_gui.cpp
# src/vehicle_base.h
# src/video/cocoa/cocoa_v.mm
# src/video/cocoa/event.mm
# src/video/cocoa/wnd_quartz.mm
# src/viewport.cpp
# src/widgets/tree_widget.h
4 years ago
Jonathan G Rennison
33d9e48bcf
Add setting for inflation dates mode
4 years ago
Jonathan G Rennison
39df1c49a1
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/fileio.cpp
# src/group_gui.cpp
# src/industry.h
# src/lang/korean.txt
# src/linkgraph/linkgraphjob.cpp
# src/linkgraph/linkgraphjob.h
# src/linkgraph/linkgraphschedule.cpp
# src/linkgraph/linkgraphschedule.h
# src/openttd.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/town_cmd.cpp
# src/vehicle_gui.cpp
# src/vehicle_gui_base.h
4 years ago
Jonathan G Rennison
43980639de
Merge branch 'master' into jgrpp
...
# Conflicts:
# .gitignore
# CMakeLists.txt
# src/3rdparty/optional/optional.hpp
# src/group_cmd.cpp
# src/industry_cmd.cpp
# src/misc_gui.cpp
# src/video/sdl2_v.cpp
4 years ago
Jonathan G Rennison
ed0ffb6220
Add feature: realistic train braking
...
Add setting to select train braking model.
4 years ago
glx22
6b8ad5a9b1
Change: Apply some consistency to singleplayer related comments
4 years ago
dP
bab7de6cf2
Feature: Allow GameScripts to add additional text to Industry view window
4 years ago
Michael Lutz
a190b00af1
Fix #8589 , 653e7fa548: Motion counter is NewGRF-visible but not saved, leading to desyncs. ( #8591 )
...
(cherry picked from commit 7da224d29d
)
4 years ago
Michael Lutz
7da224d29d
Fix #8589 , 653e7fa548: Motion counter is NewGRF-visible but not saved, leading to desyncs. ( #8591 )
4 years ago
Matt Kimber
40d5fe1631
Fix eeb88e8: Trains reversed while paused do not correctly update sprite bounds ( #8540 )
4 years ago
Jonathan G Rennison
515aeb04e0
TBTR: Add support for vehicle reversed flag
4 years ago
Patric Stout
ef6b17baf7
Fix 2fd871e2af5: load correct ending-year for old (pre 0.7) savegames
...
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.
4 years ago
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
4 years ago
Matt Kimber
9b28b15e67
Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods
4 years ago
Patric Stout
8596b43b2b
Codechange: move some DEBUG-levels and remove some others in saveload 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.
4 years ago
Jonathan G Rennison
5721790c5d
Fix assert failure in DoStartupNewCompany when called from AfterLoadGame
4 years ago
Pavel Stupnikov
f39a00d676
Feature: Set exclusive access to industry from GS ( #8115 )
...
(cherry picked from commit 9a45a0f535
)
4 years ago
Niels Martin Hansen
4d97fbc814
Feature: Influence industry production changes from GS ( #7912 )
...
(cherry picked from commit b7751c483e
)
4 years ago
Patric Stout
488187a423
Fix: next 67 savegame versions are used in PatchPacks; skip them ( #8411 )
...
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.
(cherry picked from commit d8c8f4e72d
)
4 years ago
Michael Lutz
b408fe77f7
Codechange: Use std::string in file scanners.
4 years ago
Michael Lutz
5cbb2da794
Codechange: Even more std::string usage in file IO.
4 years ago
Michael Lutz
65f65ad2ad
Codechange: Convert some more FIO functions to take std::string.
4 years ago
Charles Pigott
860c270c73
Codechange: Replace assert_compile macro with static_assert
4 years ago
cirdan
395a5d9991
Cleanup: Remove unused ChunkType flag CH_AUTO_LENGTH
...
CH_AUTO_LENGTH is no longer used anywhere, so remove all code
that depends on it.
4 years ago
cirdan
46ff7d918b
Cleanup: Remove save-only autolength flag from economy chunk handlers
...
CH_AUTO_LENGTH is only used when saving chunks; it makes no sense
to set it for chunks without a save handler.
4 years ago
glx22
d8605ad18d
Codechange: Replace FOR_VEHICLE_ORDERS with range-based for loops
4 years ago
Jonathan G Rennison
78b06ddc40
TBTR: Fix palette recolouring of templates
...
Fix group overrides affecting template image when cloning vehicle
Update template when changing company colours
Update template images on demand instead of at load
4 years ago
Jonathan G Rennison
0c5dc5d41e
Change: [Linkgraph] Pause the game when linkgraph jobs lag ( #6470 )
...
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.
4 years ago
Pavel Stupnikov
9a45a0f535
Feature: Set exclusive access to industry from GS ( #8115 )
4 years ago
Niels Martin Hansen
b7751c483e
Feature: Influence industry production changes from GS ( #7912 )
4 years ago
Patric Stout
d8c8f4e72d
Fix: next 67 savegame versions are used in PatchPacks; skip them ( #8411 )
...
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.
4 years ago
Jonathan G Rennison
8ac436f507
Add setting to scale primary industry cargo production
4 years ago
Jonathan G Rennison
f0c3a4b42e
Saveload: Store NewGRF name in savegame, include in missing GRF message
4 years ago
Jonathan G Rennison
207c79a736
Saveload: Fix SLE*_CONDSSTR* macros
4 years ago
Patric Stout
d15dc9f40f
Add: support for emscripten (play-OpenTTD-in-the-browser)
...
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>
4 years ago
Michael Lutz
79240eab1e
Codechange: Make use of the improved C++17 emplace_back function.
4 years ago
Jonathan G Rennison
840e459601
Revert "Fix 63ccb36ef3: Crash trying to load TTO/TTD savegames. ( #8356 )"
...
This is not necessary due to 5243cfd6d0
.
This reverts commit c558936ec3
.
4 years ago
Jonathan G Rennison
4436da7436
Saveload: Skip GetVariableAddress asserts if _DEBUG not defined
4 years ago
Jonathan G Rennison
4da3cfcf56
Merge branch 'master' into jgrpp
...
# Conflicts:
# CMakeLists.txt
# src/bootstrap_gui.cpp
4 years ago
Patric Stout
731af1f1f3
Codechange: don't do work GetVariableAddress() is already doing
4 years ago
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
Michael Lutz
c558936ec3
Fix 63ccb36ef3: Crash trying to load TTO/TTD savegames. ( #8356 )
4 years ago
Jonathan G Rennison
3e1ab88323
Fix NRT road/tram type conversion on savegame load from JokerPP v1.27
4 years ago
Jonathan G Rennison
270a748b64
Tracerestrict: Add time/date conditional
4 years ago
Jonathan G Rennison
2ad446369d
Cache animated tile speed, use btree map for animated tiles
4 years ago
Jonathan G Rennison
1f54c8a018
Send vehicle caches to network clients to prevent desyncs due to bad GRFs
4 years ago
Jonathan G Rennison
9efeb3551a
Tunnel/bridge signal simulation spacing is now a company setting
4 years ago
Jonathan G Rennison
0902243ab3
Allow changing the colour of plans
4 years ago
Jonathan G Rennison
57d47b9bae
Add support for overtaking inside (non-custom) bridges/tunnels
4 years ago
Jonathan G Rennison
ffe3c769a3
Add road tile cached one way state, one way road section detection
4 years ago
Jonathan G Rennison
3a75f13874
Allow drive-through road stops to be one-way
4 years ago
Jonathan G Rennison
de5fb361ad
Fix crash when saving order backups
4 years ago
Jonathan G Rennison
e1aca1ab34
Extend Order::flags to 16 bits, fixes conditional order target field size
...
Adjust order packing and CmdInsertOrder
See: #198
4 years ago
Jonathan G Rennison
b9f7db9c7e
Jump counter is no longer a separate field
4 years ago
Jonathan G Rennison
1716083a30
Use saveload object filtering for order chunks
4 years ago
Jonathan G Rennison
bb862100af
Fix operator typo in 6dd7b286
in oldloader_sl.cpp
4 years ago
Jonathan G Rennison
6dd7b2869c
Increase per-vehicle order limit to 64k
...
See: #110
4 years ago
Jonathan G Rennison
cce6d731a1
TBTR: Delete orphaned virtual trains on client disconnection
4 years ago
Jonathan G Rennison
3b47b7b091
Plans: Improve performance of viewport plan rendering
4 years ago
Jonathan G Rennison
84dd35b685
Add drive-through train depot emulation (default off)
4 years ago
Jonathan G Rennison
4763f441f6
On load, use previous local company or first usable company
...
Instead of always using the first company slot
4 years ago
Jonathan G Rennison
2ea3a7d6f4
Add setting for default road/tram types, to match default rail type setting
4 years ago
Jonathan G Rennison
2d350d26db
Add rate limit for object construction
4 years ago
Jonathan G Rennison
ff12051ee1
Only show ship is lost messages if lost for a significant time
4 years ago
Jonathan G Rennison
825190db0c
Remove programmable pre-signal calls to DebugPrintProgram
4 years ago
Jonathan G Rennison
abb7b69861
Add slot and counter support to programmable pre-signals
4 years ago
Jonathan G Rennison
9ee8091ecc
Add conditional order which tests counter value
4 years ago
Jonathan G Rennison
817bc44a3e
Initial implementation of tracerestrict counter mechanism
4 years ago
Jonathan G Rennison
d2594ece79
Add routing restrictions action to control news reports about stuck trains
4 years ago
Jonathan G Rennison
beaeda2990
TBTR: Show empty and full train weights in GUI, and weight ratios if enabled
4 years ago
Jonathan G Rennison
e2de103d82
Skip GRF compatibility check when using -K/-q switches
4 years ago
Jonathan G Rennison
5b78090a61
Merge branch 'master' into jgrpp
...
# Conflicts:
# CMakeLists.txt
# src/saveload/town_sl.cpp
# src/screenshot.h
# src/script/api/ai/ai_date.hpp.sq
# src/script/api/ai/ai_marine.hpp.sq
# src/script/api/ai/ai_station.hpp.sq
# src/script/api/game/game_date.hpp.sq
# src/script/api/game/game_marine.hpp.sq
# src/script/api/game/game_station.hpp.sq
# src/script/api/game/game_window.hpp.sq
# src/script/api/script_window.hpp
# src/script/api/template/template_window.hpp.sq
# src/signal.cpp
# src/statusbar_gui.cpp
# src/toolbar_gui.cpp
# src/viewport.cpp
# src/viewport_func.h
4 years ago
Jonathan G Rennison
2b9c633d50
Add leave early if any/all cargoes fully loaded timetable modes
4 years ago
Jonathan G Rennison
1fd9c929ef
Increase church/stadium count field size, fix save/load
...
Fix too many error message
4 years ago
Jonathan G Rennison
b7118b60fe
Add setting to enable multiple churches/stadiums in scenario editor
...
See: #177
4 years ago
dP
452e1e3328
Codechange #8258 : Remove unused town cargo caches from the savegame
4 years ago
TechGeekNZ
a10013dd00
Codechange: Spell 'Viewport' consistently
...
Some places in the codebase misspell 'Viewport' as 'ViewPort' or 'view_port'.
This patch makes everything consistent.
4 years ago
Jonathan G Rennison
1f5de8b82c
Auto separation: Remove circular linked list, use new algorithm
4 years ago
Jonathan G Rennison
53f9fa139d
Remove redundant year/month date globals
4 years ago
Jonathan G Rennison
6288abae56
Saveload: Improve error messages for loading unsupported versions
4 years ago
Jonathan G Rennison
f4cf966167
Saveload: Add version label feature to SLXI chunk
4 years ago
Jonathan G Rennison
3adeff1883
Merge branch 'master' into jgrpp
...
# Conflicts:
# CMakeLists.txt
# cmake/CompileFlags.cmake
# src/bridge_gui.cpp
# src/saveload/afterload.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/saveload/town_sl.cpp
# src/screenshot.cpp
# src/screenshot.h
# src/toolbar_gui.cpp
# src/town.h
# src/town_cmd.cpp
4 years ago
Jonathan G Rennison
d6f785d125
Merge branch 'pr-163' into jgrpp
4 years ago
Jonathan G Rennison
1aefc9d010
Use malloc instead of calloc for MemoryDumper::AllocateBuffer
4 years ago
TechGeekNZ
cf8ea74733
Update: Merge branch 'jgrpp_master_cmake' into jgrpp_cmake
4 years ago
dP
7045186594
Change #8159 : Remove now unused town cargo caches without bumping the savegame version
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