Commit Graph

1109 Commits (ab535c0a8665e6380c5037d7b6f0a507fc91d36a)

Author SHA1 Message Date
Peter Nelson ab535c0a86
Codechange: Add base() method to StrongType to allow access to the base type without casting. (#11445)
This removes the ability to explicitly cast to the base type, but the requirement
to use .base() means the conversion is still explicit.
8 months ago
Tyler Trahan 2dd2910ab3
Feature: Cheat to fix station ratings at 100% (#11346) 8 months ago
Rubidium c9276c2959 Codechange: replace x.size() == 0 with x.empty() 8 months ago
Peter Nelson 9602de474d Codechange: Use iterators and/or range-for on cargo related loops. 8 months ago
Peter Nelson b5dc9328f2
Change: Store station blocked/wires/pylons flags in map. (#11337)
This stores three flags in unused map bits, and avoids having to look up
station graphics and custom station specs to determine blocked/wires/pylons
status.

This potentially affects rail pathfinding performance.

Savegame version is not bumped, as the flags can just be updated every
time.
9 months ago
Peter Nelson 49dae08a3b Codechange: Add missing override specifiers. 9 months ago
frosch a7707302e6 Codechange: silence false warning. 9 months ago
frosch b6c8f301be Codechange: Silence warnings about intentionally unused parameters. 9 months ago
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.
9 months ago
Patric Stout d1a0ca67be
Codechange: simplify splitting of CargoPacket (#11286) 10 months ago
PeterN acd7d3c913
Codechange: Rename *Railtype* to *RailType* for consistency. (#11287) 10 months ago
Patric Stout 7e3cdbaf62 Fix: mark next_station as INVALID_STATION when loading from older savegames 10 months ago
Patric Stout 9e3763cfb3 Fix b0e73277: save/load next_station for CargoPacket again 10 months 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.
10 months ago
Tyler Trahan 701a61c9af Codechange: Delete date_type.h 10 months ago
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 10 months ago
Tyler Trahan fca2b37726 Codechange: Move Ticks into their own class 10 months ago
Patric Stout 30172fc037
Codechange: cleanup CargoPacket in terms of variable/function names (#11278)
Over the years, things got reused and changed, making the current
names somewhat unclear in what they actually mean and do.
10 months ago
Patric Stout b0e73277d6
Codechange: remove loaded_at_xy from CargoPacket as it was unused (#11276) 10 months ago
Peter Nelson 9040d7813d Codechange: Use std::array and std::unique_ptr for PersistentStorageArrays.
This (mostly) avoids the need for manual memory management and copying.
10 months ago
Patric Stout 07730584d7
Codechange: make explicit when a TileIndex is cast to its basetype (#11190)
This prevents people accidentially assigning a TileIndex to a Date
or any other type they shouldn't.
11 months ago
Patric Stout 299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 11 months 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>
11 months 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
11 months ago
PeterN c3d1264a4b
Change: Don't save industry history if cargo slot isn't used. (#11133)
This avoids saving history of 16 slots per industry when in many cases (NewGRF dependent) only a couple are used.
12 months ago
rubidium42 9f6fec01cd
Codechange: rename cargo aging days to periods, as they are not really days (#11112) 12 months ago
Rubidium 18a31cca7c Codechange: do not make a string valid in place, to then copy it 12 months ago
PeterN ed06c6bdcf
Codechange: Use vector when migrating old savegame orders. (#11020) 1 year ago
Rubidium 97dd84d1e0 Codechange: move saveload string fixing code to saveload 1 year ago
Rubidium 9408ab4799 Codechange: only one '\0' is required 1 year ago
Rubidium 55dfca1936 Codechange: replace seprintf with C++ style formatting 1 year ago
Rubidium fbd71a9d72 Codechange: replace C-style string processing with C++-style for the listing callbacks 1 year ago
Rubidium 993f90b6a0 Codechange: let GenerateDefaultSaveName return std::string 1 year ago
Rubidium d9f8a4c380 Codechange: use std::string GetString variant 1 year ago
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.
1 year ago
Peter Nelson 76516d7f70 Codechange: Use IsValidCargoID/IsValidCargoType.
IsValidCargoType() is used only for unmapped IDs.
1 year ago
axet 60540f7df6 Change: Allow dedicated server to use threaded saves. (#10787)
Co-authored-by: Jonathan G Rennison <j.g.rennison@gmail.com>
1 year ago
Rubidium 3323402aaa Codechange: rename smallvec_type to container_func and use only when needed 1 year ago
Rubidium acec34a0fe Cleanup: remove MD5SumToString in lieu of FormatArrayAsHex 1 year ago
Peter Nelson 91e140c722 Codechange: Use unique_ptr for fios company properties.
This is the data used to show company names in the saveload window.
1 year ago
Peter Nelson c38df2d589 Codechange: Use std::map instead of custom SmallMap. 1 year ago
Peter Nelson 56085be9bd Codechange: Move includes for common STL headers to stdafx. 1 year ago
Rubidium e9c03f0dad Cleanup: remnants of C-style strings in saveload 1 year ago
Rubidium 52a7c69974 Codechange: rework Gamelog changes from union to classes 1 year ago
Patric Stout 199e41c762
Codechange: use default dtor instead of empty (#10826) 1 year ago
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.
1 year ago
Rubidium 9f2fc860ad Codechange: use std::optional<std::string> for changing the script over char * 1 year ago
Michael Lutz 72c7536325
Codechange: Use a dedicated variable for disaster vehicle action state. (#10798) 1 year ago
Peter Nelson e6740046ee Codechange: Use range-for iteration. 1 year ago
Peter Nelson cef3a2570d Codechange: Use standard iterator-erase-loop pattern. 1 year ago