1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-19 02:12:37 +01:00
Commit Graph

1294 Commits

Author SHA1 Message Date
Rubidium
1464d5fd06 Codechange: [Script] Simplify constructors and add constness 2026-01-03 07:51:57 +01:00
Rubidium
091035b533 Codechange: [Script] Move identical code from sub class to super class 2026-01-03 07:51:57 +01:00
Loïc Guilloux
7d32bf24d5 Codefix: some incorrect doxygen comments (#15019) 2026-01-02 21:53:34 +00:00
Loïc Guilloux
0019f3831e Codechange: [Script] Reuse memory when changing values of ScriptList items (#14966) 2025-12-24 17:26:46 +00:00
Peter Nelson
98b0197d53 Change: [Script] Include Array contents in script memory allocation total 2025-12-23 20:52:24 +00:00
Peter Nelson
e8424c0ae2 Change: [Script] Include PriorityQueue contents in script memory allocation total 2025-12-23 20:52:24 +00:00
Peter Nelson
13ec1816dc Change: [Script] Include ScriptList contents in script memory allocation total 2025-12-23 20:52:24 +00:00
Peter Nelson
d7942c3fd0 Codechange: [Script] Add allocator that uses script memory allocation accounting 2025-12-23 20:52:24 +00:00
Jonathan G Rennison
33c967a558 Codechange: [Script] Add helpers for script memory allocation accounting 2025-12-23 20:52:24 +00:00
Loïc Guilloux
b881d8ef5c Fix 9a47f53: Incorrect filter for ScriptList::KeepBetweenValue (#14957) 2025-12-22 14:09:50 +00:00
glx22
ec5e7ed5e0 Change: [Script] ScripTiletList::[Add|Remove]Rectangle are now suspendable 2025-12-21 00:37:01 +01:00
glx22
36ccc5e005 Change: [Script] ScriptList::AddList is now suspendable 2025-12-21 00:37:01 +01:00
glx22
d15dd3a036 Change: [Script] ScriptList::[Remove|Keep][Top|Bottom] are now suspendable 2025-12-21 00:37:01 +01:00
glx22
ee789a1197 Change: [Script] ScriptList::[Remove|Keep][XXXValue|List] are now suspendable 2025-12-21 00:37:01 +01:00
Loïc Guilloux
fd7f6fcf91 Codechange: [Script] Specify underlying type for ScriptList::SorterType (#14942) 2025-12-20 17:01:39 +01:00
Rubidium
67d9daed47 Codechange: [Script] Make member functions that do not change state const 2025-12-20 16:36:35 +01:00
Peter Nelson
f1e831233a Codefix: Mark destructors override. (#14925)
Remove some empty destructors.
2025-12-19 18:14:29 +00:00
Loïc Guilloux
ca1c0007b6 Codechange: [Script] Replace map of sets with set of pairs for per value storage (#14930) 2025-12-18 22:34:47 +01:00
Loïc Guilloux
9a47f53db0 Codechange: [Script] Reduce code duplication in ScriptList filtering (#14931) 2025-12-17 15:35:53 +01:00
Rito12
859b56a066 Doc: Correct file descriptions to match coding style and doxygen. 2025-12-15 17:31:00 +01:00
glx22
392f743bcd Change: [Script] ScriptList::Valuate is now suspendable 2025-12-11 23:30:27 +01:00
glx22
81b4075095 Add: [Script] Framework to make selected native calls suspendable 2025-12-11 23:30:27 +01:00
Kuhnovic
8e35553208 Feature: Configurable sign text colors in scenario editor. (#14743) 2025-12-08 17:52:19 +01:00
Michael Lutz
170c29b376 Codechange: We are heading to 16 (#14882) 2025-12-07 23:16:08 +01:00
Charles Pigott
0bf3de7658 Fix #14863: [Script] Improve documentation for GetAPIVersion (#14877) 2025-12-07 16:55:41 +00:00
Cyprian Klimaszewski
99f04f27de Doc: Update information for receiving a copy of GPL. (#14869) 2025-12-07 11:25:08 +00:00
Peter Nelson
4b7a3241bf Codechange: Remove unnecessary 'core' includes. (#14867) 2025-12-07 08:36:58 +00:00
Peter Nelson
9adc4bfc0f Codechange: Make order load/unload flags value types. (#14861)
Order Load and Unload flags have complex logic to ensure that invalid combinations aren't used. In fact, apart from FullLoad and FullLoadAny, all mixed combinations are invalid.

Simplify logic by removing the use of bit values and treat each option as a value.
2025-12-06 18:30:31 +00:00
Peter Nelson
046b0c6267 Codechange: Use enum class and EnumBitSet for various order flags. (#14783) 2025-12-06 12:29:11 +00:00
Jonathan G Rennison
712ca5e3ec Codechange: [Script] Use std::optional for script list next iteration item (#14753)
Avoids false positive updates in Remove when iterating the final item
and leftover values being returned when IsEnd is true
2025-11-29 17:36:41 +00:00
TheDude-gh
75aee10e1e Add: [Script] ScriptTile::IsHouseTile 2025-11-26 20:44:50 +01:00
Peter Nelson
98275ee5d3 Codechange: Use enum class for water-related enums. (#14804) 2025-11-19 20:35:11 +00:00
Peter Nelson
c3451b5d97 Codechange: Replace color with colour. 2025-11-18 00:02:48 +00:00
Peter Nelson
2cd5a241c5 Codechange: Use enum class for RoadTileType. 2025-11-17 20:46:05 +00:00
Peter Nelson
66b6d71e32 Codechange: Use std::initializer_list for NWidgetPart data. (#14749)
Avoids using C/C++ arrays.
2025-11-01 22:33:00 +00:00
Peter Nelson
34bbae05db Codechange: Use enum/EnumBitSet for livery in use flags. (#14746)
Replaces magic numbers.
2025-11-01 14:25:24 +00:00
SamuXarick
20fd2b5014 Codefix: Add missing 'this->' in ScriptList (#14747) 2025-10-31 11:38:49 +00:00
SamuXarick
3f19240bbe Doc 313c6c4: [Script] GetAllRailTypes and GetRailType are from ScriptEngine (#14745) 2025-10-30 13:36:43 -04:00
SamuXarick
3ebedecb4a Add: [Script] Auto-convert ObjectType bool to integer when setting values for items in lists via [] (#14308) 2025-10-29 21:18:00 +01:00
SamuXarick
e4b0e84a7c Doc 80666a0: Fix typo in game script changelog (#14714) 2025-10-24 21:19:47 +02:00
Peter Nelson
a617d009cc Codechange: Dereference with x-> instead of (*x). (#14700) 2025-10-05 15:47:33 +01:00
Peter Nelson
c9fbc41636 Codechange: Script list iterator tidying. (#14698)
* Use `iter->` instead of `(*iter).`
* Use prefix instead of postfix operators
* Use `auto` instead of explicit iterator type.
* Use `std::next()` instead of assignment then increment.
* Use range-for where possible.
2025-10-05 07:57:09 +01:00
Peter Nelson
68e37b7b50 Change: [Script] Decouple RAILTYPE_INVALID from internal presentation. (#14630)
RAILTYPE_INVALID is now -1, which matches ROADTYPE_INVALID.
2025-09-19 22:02:08 +01:00
Peter Nelson
5f20a97b36 Fix 313c6c45aa: [Script] Return rail types as list instead of bitmask. (#14617)
This is more idiomatic for scripts, and avoids exposing internal representation.
2025-09-15 13:59:04 +01:00
Michael Lutz
313c6c45aa Add: [Script] Function to get all rail types of an rail engine. 2025-09-14 17:11:26 +02:00
Michael Lutz
3ac1a2f1e4 Codechange: Store the rail type of rail engines as a RailTypes bitmask. 2025-09-14 17:11:26 +02:00
Peter Nelson
80541a7682 Fix c02ef3e456: [AI] Incorrect infrastructure cost for road/tram tiles. (#14596)
Infrastructure total count should be split between road and tram pieces.
2025-09-07 14:11:05 +01:00
Loïc Guilloux
4b9afbe35b Codefix: [Script] Mention ScriptError::ERR_STATION_TOO_SPREAD_OUT in API doc (#14562) 2025-08-31 15:18:51 +00:00
Loïc Guilloux
80666a0d51 Add: [Script] ScriptError::ERR_BRIDGE_TOO_LOW (#14560) 2025-08-31 14:04:02 +00:00
Rubidium
7c0f69a8fe Codefix: typos in comments and strings 2025-08-31 10:30:37 +02:00