Commit Graph

168 Commits

Author SHA1 Message Date
Peter Nelson
9f853c10b0 Codechange: Add compile-time check that variable size matches saveload entry. 2023-12-09 08:13:03 +00:00
Peter Nelson
cb53fed229 Codechange: Move VarType helpers to allow earlier use. 2023-12-09 08:13:03 +00:00
Peter Nelson
54ba757910
Fix #11556: Missing saveload change for OrderBackup. (#11557)
Apply the saveload change from #11468 to OrderBackup and bump again.
2023-12-07 19:31:30 +00:00
Tyler Trahan
d28caa3ced Codechange: Use ticks for timetable start date 2023-11-25 11:50:46 -05:00
Tyler Trahan
2dd2910ab3
Feature: Cheat to fix station ratings at 100% (#11346) 2023-10-21 08:35:52 -04:00
frosch
b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 2023-09-19 22:49:59 +02:00
Patric Stout
df400ef84a
Fix: only count distance traveled in vehicles for cargo payment (#11283)
No longer you can utilize the free (and instant) labour of station
workers, transporting your cargo from one part of the station to
the other. No more!

Based on patch by dP.
2023-09-19 22:16:31 +02:00
Patric Stout
b0e73277d6
Codechange: remove loaded_at_xy from CargoPacket as it was unused (#11276) 2023-09-09 20:24:46 +01:00
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>
2023-08-06 12:57:10 -04:00
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
2023-07-19 19:30:14 +02:00
rubidium42
9f6fec01cd
Codechange: rename cargo aging days to periods, as they are not really days (#11112) 2023-07-12 13:20:02 -04:00
Rubidium
993f90b6a0 Codechange: let GenerateDefaultSaveName return std::string 2023-06-04 14:11:13 +02:00
PeterN
584faaf064
Change: Reorganise industry accept/produce arrays. (#10853)
Use a array of struct for each cargo instead of an array for each statistic.
This makes iterating for acceptance and production much simpler.
pct_transported is now calculated when needed.
2023-05-25 21:25:46 +01:00
Rubidium
e9c03f0dad Cleanup: remnants of C-style strings in saveload 2023-05-16 18:32:52 +02:00
Rubidium
52a7c69974 Codechange: rework Gamelog changes from union to classes 2023-05-16 18:32:52 +02:00
Patric Stout
199e41c762
Codechange: use default dtor instead of empty (#10826) 2023-05-14 23:31:03 +02:00
Patric Stout
7634553d22 Feature: opt-in survey when exiting a game
On first start-up, the game will ask if you want to participate
in our automated survey. You have to opt-in, and can easily opt-out
(via the Options) at any time.

When opt-in, whenever you exit a game, a JSON blob will be send
to the survey server hosted by OpenTTD. This JSON blob contains
information that gives a global picture of the game just played:
- What settings were used
- How many humans vs AIs
- How long the game has been played
- Basic information about the OS / CPU

All this information is kept very generic, so there is no
chance we send private information to our survey server.
Nothing in the JSON blob could identify you as a person; it
mostly tells about the game played. At any time you can see
what the JSON blob includes, by pressing the "Preview Survey
Results" button in-game.
2023-05-14 23:22:02 +02:00
Michael Lutz
72c7536325
Codechange: Use a dedicated variable for disaster vehicle action state. (#10798) 2023-05-12 21:41:36 +02:00
Rubidium
68ff3fd062 Change: include fmt.h C++ headers in stdafx.h
This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
2023-05-08 16:49:23 +02:00
Peter Nelson
912eb68981 Change: Extend entity override manager and station spec lists to support 16 bit IDs. 2023-05-05 07:08:40 +01:00
Peter Nelson
7ccdefa1c1 Change: Increase vehicle random data from 8 to 16 bits. 2023-05-04 21:42:28 +01:00
Rubidium
ee723f26ba Codechange: Make FileToSaveLoad's title std::string and simplify assignments 2023-04-29 13:23:34 +02:00
Patric Stout
31ad990831
Codechange: move tick-counter into TimerGameTick (#10712) 2023-04-24 16:55:40 +00:00
Patric Stout
ed83c4b0da
Change: replace per-AI "start_date" with a global "competitors_interval" (#10653)
The per-AI "start_date" is a lot of custom code, and was rarely
used in the way it was meant.

While at it, also ported this part over to the new timer system.
2023-04-16 20:14:22 +02:00
Tyler Trahan
646a7e625b
Change: Use seconds for Linkgraph update settings (#10610) 2023-04-14 22:49:12 +02:00
Charles Pigott
8aea13a85b Codechange: Use fmt for SlErrorCorruptFmt 2023-04-10 18:58:48 +01:00
dP
e2f1cd44dc
Change: Increase max cargo age and let min cargo payment approach zero. (#10596)
Co-authored-by: Michael Lutz <michi@icosahedron.de>
2023-04-10 12:34:28 +02:00
Rubidium
9d2a0f3d0b Change: make GetPartialZ consistent, meaning Z of adjacent slopes continue
Previously, on a straight line of a one corner up slope with the adjacent
steep sloop the Z would increase one step every two sub pixels, except for one
case where one sub pixel is skipped. Similarly, a steep slope with two
adjacent one corner up slopes, would have a bump in the height line along the
diagonal whenever it enters/leaves the steep slope tile.
2023-04-09 19:00:26 +02:00
PeterN
f1144de509
Feature: Separate rail/road and sea/air velocity units, and add knots. (#10594)
This is achieved by packing vehicle type along with the velocity so that
the string system can decode and pick the appropriate unit.
2023-04-08 12:26:13 -04:00
Tyler Trahan
e5438891e2
Cleanup: Keep spacing saveload versions by groups of five (#10576) 2023-03-19 11:02:54 -04:00
SamuXarick
6eabbaa751 Fix #10469, 5e14a20: [Script] League Table rating element is a int64 everywhere else 2023-02-26 22:25:13 +01:00
Michael Lutz
7352f812e6 Codechange: [Linkgraph] Only store present link graph edges and not all possible edges. 2023-02-26 21:41:24 +01:00
Michael Lutz
178249e7cc Codechange: Saveload macros for entries with a custom table name. 2023-02-26 21:41:24 +01:00
Jonathan G Rennison
4c1406a4b5 Add: NewGRF road stops 2023-02-26 21:28:30 +01:00
Rubidium
4e65ec1dc4 Codechange: do not declare functions in blocks 2023-01-29 20:28:45 +01:00
Rubidium
5863d78cb4 Codechange: use commented out code, or guard by #ifdef 2023-01-26 23:47:55 +01:00
Michael Lutz
150f05dc15
Change: Heading for 14 now. (#10302) 2023-01-01 22:52:23 +01:00
Tyler Trahan
c19abebf8d
Feature: Multi-track level crossings (#9931) 2022-11-01 16:51:23 -04:00
Nicolas Chappe
f8a7b76675 Fix #9665: [Linkgraph] Fix travel times of non-direct journeys 2022-10-29 18:39:03 +02:00
dP
548f0496a9
Change: Make _tick_counter 64bit to avoid wrapping (#10035) 2022-09-21 12:42:29 +02:00
SamuXarick
e404d16929
Fix #9591: Update station docking tiles upon placing a water object on a docking tile (#9594) 2021-10-03 12:54:19 +02:00
Loïc Guilloux
38a64eb2aa
Change: Allow all tiles around docks to be docking tiles (#9578) 2021-09-26 19:31:55 +02:00
Patric Stout
394c749b6b
Change: Heading for 13 now (#9573) 2021-09-25 13:48:03 +02:00
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.
2021-08-17 14:57:59 +02:00
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.
2021-07-17 12:48:35 +02:00
Stephan
a70aa5df49
Add #9188: netsave now keeps multiple version around, similar to autosave (#9395) 2021-07-09 21:44:02 +02:00
glx22
6e627f35ac Cleanup: Remove now unneeded ChunkHandler members 2021-07-06 22:29:08 +02:00
glx22
c1a9fe6fbd Codechange: Use static array of references to ChunkHandler 2021-07-06 22:29:08 +02:00
glx22
f371a5ad70 Codechange: Preparation for ChunkHandler subclassing 2021-07-06 22:29:08 +02:00
Loïc Guilloux
ddafc0de05
Fix 39e90ec: Integers for scripts are 64bit, but saved as 32bit (#9415) 2021-07-06 21:09:08 +02:00