Commit Graph

1484 Commits

Author SHA1 Message Date
Peter Nelson
53de4c4898 Codefix 0455627d16: Don't make temporary copies of order when converting old orders. (#14808) 2025-12-08 05:06:36 +05:00
Peter Nelson
c2f269dab2 Codechange: Use enum class for water-related enums. (#14804) 2025-12-08 05:04:12 +05:00
Peter Nelson
7f476c51c8 Codechange: Use enum class for Roadside. 2025-12-08 04:59:29 +05:00
Peter Nelson
33b77c6616 Codechange: Use enum class for RoadTileType. 2025-12-08 04:58:31 +05:00
Peter Nelson
c2554e3149 Codechange: Use enum class for RailGroundType. 2025-12-08 04:57:37 +05:00
Peter Nelson
67b8fad855 Codechange: Use enum class for RailTileType 2025-12-08 04:56:43 +05:00
Peter Nelson
c80d21a41a Codechange: Use enum/EnumBitSet for livery in use flags. (#14746)
Replaces magic numbers.
2025-12-08 04:44:08 +05:00
Peter Nelson
b4908fe534 Fix: Don't set set town index for depot tiles. (#14729) 2025-12-08 04:39:31 +05:00
Peter Nelson
de9984f379 Codechange: Prefer string equality instead of comparison. (#14727) 2025-12-08 04:39:16 +05:00
Peter Nelson
09858583be Codefix: Make sure safeguards.h is the last included non-table header. (#14687) 2025-12-08 04:32:55 +05:00
Peter Nelson
3bb1b847d3 Fix 3ac1a2f1e4: Game crash due to invalid vehicle type information. (#14628)
Use std::variant instead of union for vehicle info.

RailVehicleInfo is now non-POD so using in a union causes undefined behaviour.
2025-12-08 04:15:17 +05:00
Peter Nelson
8dd7c6dba4 Codechange: Use EnumBitSet for TownFlags. (#14651) 2025-12-08 03:28:19 +05:00
Peter Nelson
9b07f24693 Fix #14631, Fix 1cb0cbcb6c: Waypoint customs spec not allocated properly on initial construction. (#14633)
Split AllocateSpecToStation/RoadStop into Allocate and Assign functions, allowing command tests to occur separately.
2025-12-08 03:24:06 +05:00
Kuhnovic
9ee5c8dd87 Change: Removed disable_node_optimization YAPF setting (#14578) 2025-12-08 03:20:19 +05:00
Peter Nelson
302266c0b9 Cleanup 3ac1a2f1e4: Don't load/save a train's railtypes property. (#14618)
A train's railtypes property is always reset by Train::ConsistChanged on load, so storing is not necessary.
2025-12-08 03:19:04 +05:00
Michael Lutz
b16ba117cc Codechange: Store the rail type of rail engines as a RailTypes bitmask. 2025-12-08 03:17:35 +05:00
Peter Nelson
89dbb0e1a8 Change: Allow bridges over locks. (#14595)
The bridge must be at least 2 levels higher than the lock.
2025-12-08 03:08:28 +05:00
Peter Nelson
dbca97f32b Change: Allow bridges over docks. (#14594) 2025-12-08 03:07:18 +05:00
dP
94b4db3a72 Move event functions out of cm_main.hpp 2025-10-02 22:52:25 +05:00
dP
00f356d0ff Fix compilation errors 2025-09-02 00:13:45 +05:00
dP
4fec64525a Merge branch 'openttd' 2025-09-01 23:28:07 +05:00
Rubidium
7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Peter Nelson
e6323e6760 Fix: File/directory titles not updated if language is changed. (#14542) 2025-08-28 17:42:00 +01:00
Peter Nelson
2978cfa5c9 Fix fbd71a9d72: Missing space after old file type identifier. (#14541) 2025-08-27 18:06:49 +01:00
Jonathan G Rennison
c4912c94e4 Fix: Incorrect use of GetDescription in town/industry load handler (#14526)
GetLoadDescription should be used instead such that skipping incoming
table fields works as expected
2025-08-25 15:16:04 +01:00
Peter Nelson
9a294ab2ed Feature: Allow stations and roadstops under bridges.
Bridges above stations will have pillars excluded if they conflict with the station layout.

Partly based on the system implemented in JGRPP.

Co-authored-by: <su@angel-island.zone>
2025-08-20 21:40:41 +01:00
Peter Nelson
1cb0cbcb6c Codechange: Standardise how AllocateSpecToStation/RoadStop are called. (#14525)
Replace use of negative value with std::optional and update doxygen.
2025-08-19 18:52:36 +01:00
Peter Nelson
bd57aee3a9 Add: Town cargo history graphs. (#14461) 2025-08-02 23:19:43 +01:00
Ian Earle
ec7c8dd095 Codefix: Updating doxygen file documentation string for group_sl.cpp (#14488) 2025-07-31 12:39:22 -04:00
Peter Nelson
56942a15c7 Add: Industry accepted and waiting history graphs.
Records amount of cargo accepted, and a rolling average of the waiting amount.

Average waiting samples the waiting amount once per day for each industry, spread out over an economy day.
2025-07-20 14:03:54 +01:00
Peter Nelson
290144c5c9 Fix #14396: Industry production graph showed zero instead of N/A.
Record the number of valid history records per industry so that the graph avoids showing values which are not present as zero.
2025-07-09 23:02:58 +01:00
dP
73cdeac5a1 Fix compilation erorrs 2025-06-30 14:21:06 +05:00
Peter Nelson
a46a3a97f3 Change: New company face definition system and UI. (#14319)
Bits used by company faces are now defined by a variable system instead of being hardcoded, allowing future expansion.

The four face types covering gender and skin colour are now separate face styles with their own definitions.
2025-06-24 07:59:49 +01:00
Jonathan G Rennison
63f1c2aa3a Codechange: Use TypedIndexContainer for typed index containers
Instead of ReferenceThroughBaseContainer
2025-06-12 18:50:49 +01:00
dP
f388ddce1f Merge branch 'openttd' 2025-06-09 19:30:22 +05:00
Peter Nelson
e2d066e5d3 Codefix: Effect vehicles don't use v->tile, so shouldn't be in the vehicle tile hash. (#14302) 2025-05-26 21:45:46 +01:00
Peter Nelson
b042e7a439 Codefix: Prefer static inline const keyword order. (#14301) 2025-05-25 20:32:56 +01:00
Peter Nelson
0455627d16 Codechange: Move ownership of Orders to OrderList. (#13948)
Removes the orders pool, and orders are now stored directly in each OrderList.

Iterating orders now no longer needs to traverse a linked-list, all orders in an OrderList are sequential.
2025-05-23 10:36:28 +01:00
Peter Nelson
000a79c093 Codechange: Improve performance of evaluating group hierarchy.
Store a list of child groups in each group, to avoid having to iterate the group pool to find its children.
2025-05-21 19:50:07 +01:00
Peter Nelson
ce83f583bc Codechange: Use EnumBitSet for VehicleRailFlags. (#14280) 2025-05-19 18:56:45 +01:00
Peter Nelson
0aacd7acb3 Codechange: Use GrfSpecFeature type instead of uint8_t. (#14253) 2025-05-12 08:44:39 +01:00
Rubidium
568b70e556 Codechange: replace memmove with std::move(_backwards) 2025-05-11 21:51:57 +02:00
Rubidium
f8aceb6c37 Codechange: use value initialisation over memset 2025-05-09 17:20:41 +02:00
Rubidium
96873dee63 Codechange: use std::array.fill over memset 2025-05-09 17:20:41 +02:00
Peter Nelson
7c834921b2 Codechange: Use FlatSet for per-industry type industry lists. 2025-05-05 14:00:38 +01:00
Rubidium
3f2b39e3f8 Codechange: replace char* where out-of-date 2025-05-04 10:43:56 +02:00
frosch
8571af9833 Codechange: Turn ZoomLevel into enum class. 2025-05-03 23:21:09 +02:00
frosch
7055ea0aee Codechange: Define sequential operators for ZoomLevel. 2025-05-03 23:21:09 +02:00
frosch
c3aa3f140c Codechange: Use more std::string_view. (#14197) 2025-05-03 18:40:37 +02:00
frosch
9ac9798d7f Codechange: Remove usages of stoi and stol. (#14196) 2025-05-03 17:46:30 +02:00