Commit Graph

1122 Commits (3a676a5af09c94e9de8a1ce584156fb04a6b2b00)

Author SHA1 Message Date
Rubidium 3a676a5af0 Codechange: replace static inline with static for non-class functions 5 months ago
Rubidium e3f49ee7a0 Codechange: coding style fixes 6 months ago
Peter Nelson 934545a674
Fix: Calculation of initial engine age was inaccurate. (#11660)
Engine age in months was calculated as the difference in days / 32, instead of the actually difference in months. This would result in engines being artificially younger if a game was started at a later date.
6 months ago
Peter Nelson bfb4254226 Fix: Changing default livery did not propagate to group liveries.
#11614 attempted to address this but did not handle 2CC properly, and changes to the default livery were not handled.
6 months ago
Peter Nelson 33ff64ef74
Codechange: Simplify ConvertDateToYMD by returning YearMonthDay instead of outputting to a pointer. (#11637) 6 months ago
Peter Nelson 47dd04d16c Fix: Don't crash when saving a crashlog save with no main window open. 6 months ago
Tyler Trahan 2a62caa30b Codechange: Use Ticks for BaseConsist timetable fields 6 months ago
Peter Nelson 10f94fb0dd Codechange: Remove runtime variable size assertion. 6 months ago
Peter Nelson 9f853c10b0 Codechange: Add compile-time check that variable size matches saveload entry. 6 months ago
Peter Nelson cb53fed229 Codechange: Move VarType helpers to allow earlier use. 6 months ago
Peter Nelson 54ba757910
Fix #11556: Missing saveload change for OrderBackup. (#11557)
Apply the saveload change from #11468 to OrderBackup and bump again.
6 months ago
Tyler Trahan 1f41e773d6 Codechange: Use consistent name for bay road stops
As of #10494, this is how we describe original dead-end road stops.
7 months ago
Tyler Trahan d28caa3ced Codechange: Use ticks for timetable start date 7 months ago
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.
7 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) 9 months ago
PeterN acd7d3c913
Codechange: Rename *Railtype* to *RailType* for consistency. (#11287) 9 months ago
Patric Stout 7e3cdbaf62 Fix: mark next_station as INVALID_STATION when loading from older savegames 9 months ago
Patric Stout 9e3763cfb3 Fix b0e73277: save/load next_station for CargoPacket again 9 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.
9 months ago
Tyler Trahan 701a61c9af Codechange: Delete date_type.h 9 months ago
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 9 months ago
Tyler Trahan fca2b37726 Codechange: Move Ticks into their own class 9 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.
9 months ago
Patric Stout b0e73277d6
Codechange: remove loaded_at_xy from CargoPacket as it was unused (#11276) 9 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.
9 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.
10 months ago
Patric Stout 299570b2c1
Codechange: make TimerGameCalendar Date and Year types strongly typed (#10761) 10 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.
11 months ago
rubidium42 9f6fec01cd
Codechange: rename cargo aging days to periods, as they are not really days (#11112) 11 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