Commit Graph

92 Commits

Author SHA1 Message Date
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.
2021-06-14 21:58:05 +02:00
Patric Stout
0bdca02bdf Codechange: use SLE_STRUCT(LIST) for Station chunks 2021-06-14 21:58:05 +02:00
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.
2021-06-14 21:58:05 +02:00
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.
2021-06-10 19:18:24 +02:00
glx22
c27afdf3f6 Codechange: Remove FOR_ALL_CHUNK_HANDLERS
Co-Authored-By: Patric Stout <truebrain@openttd.org>
2021-06-06 19:35:06 +02:00
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.
2021-05-31 22:26:44 +02:00
glx22
38c97e1492 Codechange: Replace TILE_AREA_LOOP with range-based for loops 2021-05-13 00:13:54 +02:00
Michael Lutz
63ccb36ef3 Codechange: Use std::string for most of the user-settable custom names. 2020-05-21 20:02:34 +02:00
glx
bc8333723c Fix #8021: limit savegame range for docking tiles fixing 2020-05-06 23:12:59 +02:00
SamuXarick
57553cd809 Fix #8020: Add missing docking tiles around industry neutral stations 2020-03-30 08:21:40 +02:00
glx
b91abd3af9 Codechange: Replace FOR_ALL_ROADSTOPS with range-based for loops 2019-12-21 20:13:03 +01:00
glx
d8a1be48cd Codechange: Replace vehicle related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
glx
9892d90b26 Codechange: Replace order related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
glx
ddabfed1cd Codechange: Replace station related FOR_ALL with range-based for loops 2019-12-21 20:13:03 +01:00
S. D. Cloudt
13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
peter1138
f538179878 Feature: Multi-tile docks and docking points. 2019-06-30 16:46:32 +02:00
peter1138
4f052fc2a4 Cleanup: Fix alignment after NULL -> nullptr change. 2019-04-13 20:35:10 +01:00
Henry Wilson
7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Peter Nelson
e21ade375e Codechange: Change from numeric to descriptive SLV enum labels for last entries. 2019-02-02 21:39:06 +00:00
Peter Nelson
9de12521ec Codechange: Convert saveload numbers to enum values.
(This was mostly achieved with a few in-place regexes)
2019-02-02 21:39:06 +00:00
Peter Nelson
ea4ea62816 Codechange: Make saveload version upper bound exclusive, i.e. version object was removed instead of version object last appeared. 2019-02-02 21:39:06 +00:00
Peter Nelson
67633606b0 Codechange: Remove value mangling and field misuse in SLE_WRITEBYTE.
The original translation functionality hasn't been used since 2007.
2019-01-30 17:11:40 +00:00
Michael Lutz
4b0b4e0643 Feature: [NewGRF] Increase size of persistent storage to 256. 2018-09-02 21:31:15 +02:00
PeterN
11ab3c4ea2
Change: Increase cargo type limit to 64. 2018-06-26 13:32:58 +01:00
fonsinchen
4e13285274 (svn r27770) -Fix [FS#6540]: Initialize variables in station_sl.cpp (JGR) 2017-03-05 17:06:14 +00:00
rubidium
982f5a6aa2 (svn r26878) -Change: move m6 to TileExtended to keep Tile 8 bytes and thus better alignable 2014-09-21 11:23:33 +00:00
rubidium
134ad63b80 (svn r26753) -Fix: desync due to not always properly restoring game state from the savegame 2014-08-22 17:11:59 +00:00
rubidium
89c25b955e (svn r26580) -Codechange: s/GES_PICKUP/GES_RATING/ (it has nothing to do with actual pickup), s/acceptance_pickup/status/ (the enum isn't called GoodEntryStatus for a reason; it's not only acceptance and pickup anymore) 2014-05-11 18:02:11 +00:00
rubidium
0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
frosch
49852e3dac (svn r26175) -Add: Log in desync output when persistent storage is discarded. 2013-12-23 18:09:29 +00:00
rubidium
b3e93d6520 (svn r26057) -Fix: a number of possibly uninitialised variables 2013-11-23 13:12:19 +00:00
fonsinchen
6524849386 (svn r25899) -Change: Restrict flows if links are restricted and don't normally pick them anymore. 2013-10-22 16:13:54 +00:00
fonsinchen
741c431caa (svn r25362) -Feature: consider cargo waiting at other stations for rating at the origin station 2013-06-09 13:04:32 +00:00
fonsinchen
04e3eb6fab (svn r25361) -Feature: distribute cargo according to plan given by linkgraph 2013-06-09 13:03:48 +00:00
fonsinchen
a2ff96d682 (svn r25360) -Codechange: save and load flow stats 2013-06-09 13:03:11 +00:00
fonsinchen
16307a8a6f (svn r25337) -Fix: saving only 8 bits of 16 causes endianness problems 2013-06-08 20:47:59 +00:00
rubidium
f292a87dc4 (svn r25312) -Fix-ish: missing spaces after comma + realignment of tables; quite boring with -x -w 2013-06-01 07:44:53 +00:00
rubidium
cdb0a76958 (svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle 2013-02-17 14:54:50 +00:00
peter1138
c00a400cc7 (svn r24905) -Feature(ish): Implement station randomisation triggers. 2013-01-11 07:39:25 +00:00
frosch
883f9bec9b (svn r24718) -Codechange: Rename GoodsEntry::days_since_pickup to GoodsEntry::time_since_pickup. 2012-11-12 21:59:02 +00:00
rubidium
6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
truebrain
102f811d02 (svn r23636) -Add: introduce ScriptText in parameters where it can be used 2011-12-19 21:06:06 +00:00
rubidium
3d88c74389 (svn r23526) -Codechange: unify cargos vs cargoes 2011-12-15 21:56:00 +00:00
terkhen
00e5c1df18 (svn r22567) -Codechange: Store persistent storages inside a pool. 2011-06-12 20:47:45 +00:00
terkhen
5bb79b1f46 (svn r22540) -Codechange: Rename AcceptancePickup to GoodsEntryStatus. 2011-06-04 21:17:07 +00:00
smatz
8074f123d5 (svn r22155) -Codechange: one comment in saveload/station_sl.cpp was wrong 2011-02-27 13:59:20 +00:00
rubidium
13fd2cd335 (svn r22057) -Fix: waypoint conversion could (previously) silently overfill the pool and crash 2011-02-11 09:33:38 +00:00
smatz
887a7724dc (svn r22025) -Fix: verify there is enough space in the pool when creating new pool items while loading old savegames 2011-02-08 18:34:13 +00:00
rubidium
85255ea001 (svn r21795) -Fix (r21790): when converting TTDPatch train waypoints, convert the data on the map as well 2011-01-14 20:52:22 +00:00
smatz
75351f4043 (svn r21794) -Fix (r21790): convert train orders too (Rubidium) 2011-01-14 19:51:50 +00:00