Tyler Trahan
2a62caa30b
Codechange: Use Ticks for BaseConsist timetable fields
10 months ago
Tyler Trahan
d28caa3ced
Codechange: Use ticks for timetable start date
10 months ago
Patric Stout
d1a0ca67be
Codechange: simplify splitting of CargoPacket ( #11286 )
1 year ago
Patric Stout
e6c02ebee6
Fix b0e73277: cargodist information got lost when splitting of cargo ( #11280 )
...
During b0e73277
we removed loaded_at_xy, but I kinda forgot that
it was a union with next_station. Now next_station wasn't copied
anymore, or checked in AreMergable.
1 year ago
Patric Stout
b0e73277d6
Codechange: remove loaded_at_xy from CargoPacket as it was unused ( #11276 )
1 year ago
Tyler Trahan
9a602ff304
Fix #10334 : Store separate newgrf-safe version of date_of_last_service. ( #11124 )
...
This value is not changed when the date cheat is used, which caused issues with changing properties based on service date.
Co-authored-by: Peter Nelson <peter1138@openttd.org>
1 year ago
Rubidium
eaae0bb5e7
Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
...
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
1 year ago
rubidium42
9f6fec01cd
Codechange: rename cargo aging days to periods, as they are not really days ( #11112 )
1 year ago
Peter Nelson
56085be9bd
Codechange: Move includes for common STL headers to stdafx.
1 year ago
Michael Lutz
72c7536325
Codechange: Use a dedicated variable for disaster vehicle action state. ( #10798 )
1 year ago
Peter Nelson
7ccdefa1c1
Change: Increase vehicle random data from 8 to 16 bits.
1 year ago
PeterN
ce046f6d17
Fix: Abort loading savegame if road vehicle is on invalid road type. ( #10622 )
...
This can happen if NewGRFs are missing so that engine or road type definitions are wrong.
1 year ago
Rubidium
9c70c38c5e
Fix: check for the existence of shadow and rotor vehicles for aircraft
...
Instead of just assuming that it exists in the savegame that got loaded.
2 years ago
Nicolas Chappe
f8a7b76675
Fix #9665 : [Linkgraph] Fix travel times of non-direct journeys
2 years ago
Niels Martin Hansen
e68bf58989
Codechange: Use anonymous union for vehicle orders/old orders list
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
Patric Stout
3826703bc3
Add: store headers for chunks with SL_STRUCTLIST
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
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
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
glx22
c27afdf3f6
Codechange: Remove FOR_ALL_CHUNK_HANDLERS
...
Co-Authored-By: Patric Stout <truebrain@openttd.org>
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
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
Matt Kimber
9b28b15e67
Codechange: create MutableSpriteCache to remove the need to cast Vehicle to a mutable type in render methods
4 years ago
Michael Lutz
63ccb36ef3
Codechange: Use std::string for most of the user-settable custom names.
4 years ago
glx
d8a1be48cd
Codechange: Replace vehicle related FOR_ALL with range-based for loops
5 years ago
glx
1f6b3a37f9
Codechange: Replace FOR_ALL_ENGINES with range-based for loops
5 years ago
glx
ddabfed1cd
Codechange: Replace station related FOR_ALL with range-based for loops
5 years ago
S. D. Cloudt
13cc8a0cee
Cleanup: Removed SVN headers
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
6 years ago
PeterN
6c6971fb43
Add: Road vehicle path cache. ( #7261 )
6 years ago
Peter Nelson
33e3f49161
Fix #7119 : When rotating a ship, apply an additional offset to avoid movement glitch.
6 years ago
Peter Nelson
e21ade375e
Codechange: Change from numeric to descriptive SLV enum labels for last entries.
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
225790892d
Change: Make ships stop and change direction slowly instead of instantly turning.
6 years ago
Peter Nelson
81330b8d6e
Change: Add path cache for ships.
6 years ago
PeterN
a07394a63a
Change: Remove direction parameter from Vehicle::UpdateDeltaXY. ( #6792 )
...
The value is either unused or always the same as this->direction.
6 years ago
J0an Josep
cfb8092397
Fix b4b98e5165: Use FALLTHROUGH attribute with correct indentation.
7 years ago
frosch
b4b98e5165
(svn r27893) -Codechange: Use fallthrough attribute. (LordAro)
7 years ago
peter1138
19d56a33e8
(svn r27822) -Feature: Vehicle Group Info: Add profits and occupancy display to group vehicle list (mtm, JGR)
8 years ago
frosch
117e73751c
(svn r27668) -Feature: [NewGRF] Allow composing vehicles from multiple sprites.
8 years ago
frosch
d2393b4f6c
(svn r27666) -Codechange: Pass vehicle sprites around using a struct VehicleSpriteSeq.
8 years ago
rubidium
51a1c712f2
(svn r26872) -Change: give the disaster vehicles the same treatment as aircraft in r26866; make the ascend and descend if needed to cross high mountains (based on patch by ic111)
10 years ago
rubidium
c0771b1657
(svn r26866) -Change: make aircraft ascend/descend when they are too close to the ground or too far away (based on patch by ic111)
10 years ago