Commit Graph

895 Commits

Author SHA1 Message Date
Michael Lutz ddf6f33a8a Change: Path signals now show green on junction-less tracks by default (#12857) 2024-07-26 23:51:49 +02:00
Loïc Guilloux d67963e616 Add: [Script] Include number of victims in ScriptEventVehicleCrashed (#12861) 2024-07-16 21:28:29 +02:00
merni-ns 55a7c59d13 Remove: NPF and pathfinder change settings 2024-05-10 10:38:44 +02:00
dP 02f7b3f1f8 Merge branch 'openttd' 2024-04-14 01:56:43 +07:00
dP 14504ff3b2 Update to 14.0 2024-04-14 01:56:35 +07:00
Jonathan G Rennison 433484cda3 Fix #12388: Vehicle::CopyVehicleConfigAndStatistics not releasing unit number (#12389) 2024-03-27 21:20:27 +01:00
Peter Nelson 3fc7b3b9a0 Codechange: Cache train curve speed limit can be stored in 16 bits.
Cache curve speed modifier and max curve speed are both 16 bit values so can be stored in 16 bit types instead of 32 bit types.
2024-03-17 16:22:38 +00:00
Patric Stout a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
dP e7a0cb83c5 Merge branch 'openttd' 2024-03-17 01:02:31 +07:00
dP da761f41e2 Update to 14.0-RC2 2024-03-17 01:01:56 +07:00
Tyler Trahan 32b0fb9f6e Fix #12010: Use economy timer for vehicle stats minimum age, not calendar (#12142) 2024-03-09 09:38:52 -05:00
Peter Nelson 56cf89d189 Change: Use bitmap for free unit ID generation. (#12165)
This improves performance of finding the next free unit number for a vehicle.

Based loosely on pool's used slot bitmap.
2024-02-25 12:36:13 +00:00
dP 5befe8fc73 Merge 14.0-beta3 2024-02-07 14:28:08 +05:30
dP 910fa762b9 Update to 14.0-beta3 2024-02-07 13:59:10 +05:30
Peter Nelson 2fd9096070 Change: Decouple and remove landscape-dependent cargo types. (#11719)
Cargo types of default engines, industries and houses are now specified in terms of label.
2024-02-04 10:16:08 +00:00
dP 7a1afa55d6 Merge branch 'openttd' 2024-02-04 02:48:37 +05:30
dP 33ef333b57 Update to 14.0-beta1 2024-02-04 02:18:17 +05:30
Tyler Trahan f6dd5053a3 Feature: Order flag to unbunch vehicles at depot (#11945) 2024-02-03 08:04:24 -05:00
frosch b1718478c8 Codechange: Replace old non-standard attributes with C++17/20 standard attributes. 2024-02-02 22:29:28 +01:00
Tyler Trahan 735abfe111 Codechange: Split dates and timers into Economy and Calendar time (#10700) 2024-01-22 09:04:34 -05:00
Rubidium 6b21368bc2 Codechange: replace FIND_FIRST_BIT/FindFirstBit2x64 with FindFirstBit 2024-01-19 21:10:39 +01:00
Peter Nelson ddd609ce9b Feature: Randomize direction of rail vehicle on build based on probability callback. (#11489)
This allows NewGRF authors to indicate that the game should randomly flip rail vehicles on build, without needing to use random bits nor duplicate sprites to handle it themselves.

To use this functionality, test for callback 162 (CBID_VEHICLE_BUILD_PROBABILITY)  and var10 = 0 (values other than 0 are reserved for future use), and return a value between 0 and 100 inclusive.

The return value is a percentage chance of reversing the vehicle. A value of 0 will always build a forward facing vehicle, and 100 will always build a reverse facing vehicle.
2023-11-29 22:40:09 +00:00
Peter Nelson e6d132d24b Fix #10926: New free wagons no longer split by type. (#11507)
NormalizeTrainVehInDepot() should only be called if an engine was built, not for wagons.
2023-11-28 13:48:09 +00:00
Peter Nelson 43aa91a7f5 Fix #11437: Flipped shorter rail vehicles disappear in windows. (#11446)
Mixed signed/unsigned strikes again, causing an incorrect sprite offset for shortened vehicles.
2023-11-05 20:09:11 +00:00
Rubidium c9276c2959 Codechange: replace x.size() == 0 with x.empty() 2023-10-20 23:05:43 +02:00
Jonathan G Rennison 3afb732c37 Fix #11307: Incorrect GroupStatistics after selling leading wagon
When this results in a countable consist
2023-09-17 18:42:37 +01:00
PeterN acd7d3c913 Codechange: Rename *Railtype* to *RailType* for consistency. (#11287) 2023-09-11 08:55:12 +00:00
Tyler Trahan 77173a6a10 Codechange: Move date consts and functions to CalendarTime and TimerGameCalendar classes 2023-09-10 08:40:25 -04:00
Tyler Trahan fca2b37726 Codechange: Move Ticks into their own class 2023-09-10 08:40:25 -04: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
dP 97085a19d5 Merge branch 'openttd' 2023-06-10 18:03:17 +04:00
dP 0c29a3a5fb Update to 13.2 (github source) 2023-06-10 18:03:07 +04:00
merni-ns 1be668c2e4 Fix #10975: Clear a non-head engine's name (#10976) 2023-06-09 16:09:36 +01:00
PeterN ee2d0745e9 Fix #10502: Refit engine before attaching free wagons. (#10926)
Caused by incorrect order of operations when buying a train engine with refit and attaching free wagons.
2023-06-04 15:57:36 +01:00
Jonathan G Rennison a2c0e6aa18 Fix #10831: Level crossing parts left barred after crossing tile removal (#10874) 2023-06-03 23:04:24 +02:00
Michael Lutz 7e906c7c59 Change: Preserve orders and related settings where possible when moving engines around in a train. 2023-05-10 00:35:02 +02:00
Michael Lutz 07449be876 Codechange: A vehicle that is not a front engine can't be removed from a vehicle group, so just remove a pointless function call. 2023-05-10 00:35:02 +02:00
Jonathan G Rennison 8d501f2db1 Fix #10741: Rail platforms left partially reserved after train crash (#10751) 2023-05-04 21:45:13 +01:00
Peter Nelson 4a5e413a6c Cleanup: Remove unnecessary VehicleRandomBits()
Simple Random() assignment to byte does the same.
2023-05-04 21:42:28 +01:00
Rubidium f74e26ca7e Codechange: replace error/usererror printf variant with fmt variant and rename 2023-04-25 17:55:09 +02:00
Patric Stout 7aa2b9ab0a Codechange: move all date-related variables inside the timer (#10706) 2023-04-24 15:56:01 +00:00
dP 86aa0df125 Merge branch 'openttd' 2023-04-10 23:55:25 +04:00
dP 9743ba7d99 Update to 13.1 (github source package) 2023-04-10 23:55:14 +04:00
Rubidium e8af8daa68 Codechange: pass "ground vehicle" to GetTileSlopeZ since for tunnel/bridges there are two states
Previously it checked the position in non-driving direction to "guess" whether
a ground vehicle was using the function, so on tunnels/bridges it could either
return the Z of the (virtual) ground compared to the Z of the path the vehicle
would take.
2023-04-09 19:00:26 +02:00
SamuXarick b52b29b1a4 Change: Avoid crashing to the side of a train
When a road vehicle is already running on a multi level crossing, and a train shows up ahead, don't make the road vehicle crash on the side of the train.
2023-02-22 20:09:02 +01:00
rubidium42 6ba55e663e Codechange: do not hide variables with other variables 2023-01-29 07:21:34 +01:00
Rubidium fe2bcd2a58 Codechange: migrate size related functions to Map structure 2023-01-21 17:11:40 +01:00
Rubidium 375a5b8e3f Codechange: refactor FindClosestDepot to not use pointers, but return a struct 2023-01-04 22:30:48 +01:00
Pavel Stupnikov 78c5d4161f Merge branch 'openttd' 2023-01-03 19:05:48 +04:00