Commit Graph
232 Commits
Author SHA1 Message Date
Peter NelsonandGitHub a7c078dcaf Codechange: use scoped enum for MoveToAction (#15621) 2026-05-31 08:16:51 +01:00
Cyprian KlimaszewskiandGitHub d490243c7f Codechange: Use ExtractCommandCost instead of std::get<0>. (#15542) 2026-05-26 20:00:29 +01:00
Rubidiumandrubidium42 bcda4a72ee Codechange: make WindowClass a scoped enum 2026-05-20 21:39:04 +02:00
Peter NelsonandGitHub a7a025623e Codechange: make RailVehicleType a scoped enum (#15576) 2026-05-04 22:58:05 +01:00
Peter NelsonandGitHub 792f6d99a3 Codechange: make ExpensesType a scoped enum (#15572) 2026-05-04 08:20:52 +01:00
Peter NelsonandPeter Nelson 77403627a8 Codechange: make VehicleType a scoped enum 2026-04-26 07:00:13 +01:00
Peter NelsonandPeter Nelson c45aa3c9b6 Codechange: use EnumBitSet for CargoTypes 2026-04-21 17:13:31 +01:00
Peter NelsonandGitHub 16b192d61f Fix #15511: vehicle passed to commands must be a company buildable type (#15512) 2026-04-19 17:03:39 +01:00
Cyprian Klimaszewskiandrubidium42 21bee91fa7 Codechange: Make some variables and constants documentation comments recognised by doxygen. 2026-02-21 15:05:13 +01:00
Rubidiumandrubidium42 c7468a6922 Codechange: add missing @param and @return 2026-02-15 22:14:37 +01:00
Rubidiumandrubidium42 73232058d9 Codechange: deduplicate code by dereferencing in callee instead of callers 2026-02-01 15:50:17 +01:00
Rubidiumandrubidium42 4adf494ebc Codechange: enum-class-ify Commands 2026-01-28 23:32:51 +01:00
Rito12andrubidium42 859b56a066 Doc: Correct file descriptions to match coding style and doxygen. 2025-12-15 17:31:00 +01:00
Cyprian KlimaszewskiandGitHub 99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter NelsonandGitHub 42c9f84d74 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-09-24 22:44:41 +01:00
Michael Lutz 3ac1a2f1e4 Codechange: Store the rail type of rail engines as a RailTypes bitmask. 2025-09-14 17:11:26 +02:00
Rubidiumandrubidium42 7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00
Peter NelsonandGitHub 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 NelsonandGitHub a2addf0fe7 Fix: Clear rail vehicle flipped flag if reverse probability callback returns false. (#14281)
This now distinguishes between not-flipped and callback not implemented.
2025-05-20 23:03:55 +01:00
Peter NelsonandGitHub ce83f583bc Codechange: Use EnumBitSet for VehicleRailFlags. (#14280) 2025-05-19 18:56:45 +01:00
Peter NelsonandPeter Nelson 47d078c033 Codechange: Use EnumBitSet for RailTypes. 2025-03-25 20:15:48 +00:00
Peter NelsonandPeter Nelson 732109e444 Codechange: Use EnumBitSet for RoadTypes. 2025-03-25 20:15:48 +00:00
Peter NelsonandGitHub 17f7d0950e Fix #13838: Formatted error message of sub-errors may be lost. (#13840) 2025-03-18 08:39:40 +00:00
Peter NelsonandGitHub 91d22f7617 Codechange: Use EnumBitSet for VehStates. (#13755)
Renamed from VehStatus because pluralising that is weird.
2025-03-08 18:24:21 +00:00
Peter NelsonandGitHub 6e10584b91 Codechange: Use EncodedStrings for News messages. (#13654) 2025-02-23 20:24:02 +00:00
Rubidiumandrubidium42 fd4adc55e3 Codechange: replace INVALID_X with XID::Invalid() for PoolIDs 2025-02-16 20:23:00 +01:00
Rubidiumandrubidium42 2d30df8110 Codefix: 'Declaration hides variable' 2025-02-16 13:44:37 +01:00
Rubidiumandrubidium42 c3d5e6d2a0 Codechange: Use EnumBitSet for DoCommandFlags 2025-02-14 00:28:57 +01:00
Rubidiumandrubidium42 5a78bb8fac Codechange: ToWindowNumber describes better what is the intent than Pack 2025-02-02 15:57:18 +01:00
Peter NelsonandPeter Nelson 6c4ddb242a Codechange: Use EnumBitSet for EngineMiscFlags. 2025-01-31 18:55:31 +00:00
Peter NelsonandPeter Nelson 5ef495da78 Codechange: Use EnumBitSet for GroupFlags. 2025-01-29 21:46:39 +00:00
Rubidiumandrubidium42 e894a5880c Codechange: rename CargoID to CargoType and amend related variables/comments 2025-01-26 18:07:10 +01:00
Peter NelsonandGitHub 95f8fc983b Codechange: Make GroupFlags an enum class. (#13312)
GF_END is 'reserved' in some Windows APIs. Instead of working around it, make GroupFlags an enum class.
2025-01-14 11:33:26 +00:00
Rubidiumandrubidium42 08d84b2f4a Codechange: use AdviceType over StringID to remove vehicle advice news 2025-01-08 02:03:55 +01:00
Patric StoutandGitHub a3cfd23cf9 Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01:00
Peter NelsonandGitHub b1c5e03df1 Fix: Don't issue autoreplace failed news message for command test mode. (#12026) 2024-02-07 12:07:00 +00:00
Peter NelsonandGitHub 1f8533ebe0 Fix #12024: Autoreplace failed news message for trains must go to lead engine. (#12025) 2024-02-07 08:51:03 +00:00
Peter NelsonandGitHub 0841978304 Codechange: Use vector and iterators to store old/new vehicles during autoreplace. (#11851)
This avoids malloc/free of 3 arrays along index counting, and the data for each part is kept together.
2024-01-21 09:21:22 +00:00
Peter NelsonandPeter Nelson 400ae65ff2 Codechange: Redefine some cargo-related values in terms of CargoID instead of CargoType.
Values used as special filter types are now defined as offsets from NUM_CARGO instead of confusingly reusing CARGO_NO_REFIT/CARGO_AUTO_REFIT types.
2024-01-09 18:56:05 +00:00
Peter NelsonandPeter Nelson 952d111b94 Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO.
INVALID_CARGO is a CargoID and should be used for most purposes in game.
CT_INVALID is a CargoType used for defining default properties.
2024-01-09 18:56:05 +00:00
Jonathan G RennisonandGitHub 9822fa6584 Fix: Trivial autoreplace of mixed cargo articulated engines (#11253)
Do not fail autoreplace/autorenew of mixed cargo articulated engines
due to an inability to refit to mixed cargoes, when no refit is
required because the target engine already has a suitable set of cargoes.
Notably, this allows autorenew (autoreplace to same engine type)
to succeed.
2023-11-20 14:16:28 +01:00
Rubidiumandrubidium42 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
PeterNandGitHub 2a2443dd01 Feature: Create group of vehicles from manage vehicle list button. (#10890) 2023-06-18 20:48:04 +01:00
Peter NelsonandPeterN 76516d7f70 Codechange: Use IsValidCargoID/IsValidCargoType.
IsValidCargoType() is used only for unmapped IDs.
2023-05-22 20:43:40 +01:00
Tyler Trahan 44848f4edf Add: CommandCost supports an optional second error string 2023-03-03 17:11:14 -05:00
Niels Martin Hansenandrubidium42 2fee8ecdda Add #7525: Allow autoreplace with same model vehicle 2023-02-26 21:29:25 +01:00
rubidium42andrubidium42 6ba55e663e Codechange: do not hide variables with other variables 2023-01-29 07:21:34 +01:00
SamuXarickandGitHub b2a5ebcfc4 Fix 3c047b1: AIGroup.GetProfitLastYear could get values different than those displayed in GUI (#10227)
* Change: Store "all time" and "since minimum age" last year profits on groups

* Fix: Update last year profit for groups when copying vehicle statistics on autoreplace

* Codechange: Refactor profit last year

* Change: Rename some group related items for clarity

* Change: Reorder the fields in GroupStatistics

That way less memory gets wasted.
2023-01-22 08:14:02 -05:00
Jonathan G Rennisonandrubidium42 10e76b2788 Fix #10032: Capacities of articulated vehicles in build window
See also: #9954
2023-01-14 18:52:01 +01:00
Patric StoutandGitHub 77a85e9b4c Fix: CmdSetAutoReplace didn't validate group type and engine type match (#9950)
Basically, you could setup an auto-replace in a group for trains
to replace a ship with another ship.

Most of the code is surprisingly okay with this, it is only the
group statistics that doesn't like this.
2022-07-09 20:06:22 +02:00