Commit Graph
899 Commits
Author SHA1 Message Date
Patric StoutandPatric Stout 6f0c6fb2ae Fix a4987233: NewGRFs could no longer be loaded from the NewGRF folder.
This statement was removed by accident, as it felt it could be removed.
But it is used to know if the NewGRF is from the baseset folder or
from the NewGRF folder.
2021-07-11 12:16:07 +02:00
rubidium42andGitHub a498723345 Remove: arbitrary limit on number of statically loaded NewGRFs (#9431) 2021-07-11 11:23:47 +02:00
glx22andLoïc Guilloux a543a4b7bb Codechange: Remove FOR_EACH_SET_CARGO_ID 2021-07-09 21:36:09 +02:00
glx22andLoïc Guilloux 89ab8b79a5 Codechange: Remove FOR_EACH_SET_BIT 2021-07-09 21:36:09 +02:00
rubidium42andrubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
Peter NelsonandPeterN 40cec34836 Change: Skip creating a RealSpriteGroup when there is only one result.
This avoids checking RSG for empty sets every time they are evaluated.
This might alter behaviour in cases of a malformed NewGRF file.
2021-06-12 08:05:59 +01:00
Patric StoutandGitHub ca9a7df752 Codechange: rename str_validate to StrMakeValid(InPlace) (#9304)
This to be more explicit the function changes the value, and not
returns yes/no.
2021-05-29 11:21:38 +02:00
rubidium42andrubidium42 ae85af98eb Codechange: Use std::string GetString where convenient 2021-05-15 10:20:50 +02:00
rubidium42andrubidium42 44ca7d9377 Change: Use gender-neutral pronouns 2021-05-15 10:16:48 +02:00
Rubidiumandrubidium42 e6f0d63e25 Codechange: comparison result is always the same due to earlier check
Practically the length of the handlers not being equal to the number of
features is the problem as it means something was forgotten when adding
a new feature, so static assert to that and let the existing check on
the feature number take care of invalid data from the NewGRFs.
2021-05-15 10:16:10 +02:00
froschandfrosch 1da0ba95b2 Feature: Define refittability of default vehicles using cargo classes.
This ensures that default vehicles can transport any NewGRF defined cargos, albeit with weird graphics and vehicle names.
This also changes the refittability of default vehicles with default industries.
2021-05-13 23:28:43 +02:00
froschandfrosch 9f8d0b1bee Fix: Resolve cargo-types of default vehicles via their cargo label.
Default vehicles now behave as if they had a cargo translation table. This fixes default vehicles carrying seemingly random cargos, if NewGRF industry sets are present.
This behavior is disabled, when a NewGRF touches any of the cargo-type or refitting properties. In that case it's up to the NewGRF to define its own cargo translation table.
2021-05-13 23:28:43 +02:00
rubidium42andrubidium42 65cbde4b30 Codechange: move currency settings to std::string 2021-05-13 23:13:17 +02:00
Rubidiumandrubidium42 296194ad36 Fix: memory leak due to assigning result of strdup to a std::string 2021-05-10 16:03:31 +02:00
Rubidiumandrubidium42 10e35ca8e4 Codechange: let NewGRF make use of SpriteFile instead of most of the FIO slot functions 2021-05-08 12:39:34 +02:00
Rubidiumandrubidium42 fdc11a9f94 Codechange: introduce SpriteFile to be used by the sprite loader instead of the global FIO slot functionality 2021-05-08 12:39:34 +02:00
Rubidiumandrubidium42 c097bc9d7d Codechange: let NewGRF sounds make use of RandomAccessFile instead of the FIO slot functions 2021-05-08 12:39:34 +02:00
Peter NelsonandPeterN 756034fa27 Codechange: Validate custom station platform layout tiles are permitted values only. 2021-05-02 17:15:27 +01:00
Peter NelsonandPeterN a3e49178d1 Codechange: Use std::vector for NewGRF station tile sprite layouts. 2021-05-02 17:15:27 +01:00
Peter NelsonandPeterN bd1a20f6ee Codechange: Use std::vector for NewGRF station platform layouts.
This avoids the need to custom memory management and additional members.

This also resolves use-after-free if modifying copied layouts, so presumably nobody has ever done that.
2021-05-02 17:15:27 +01:00
Peter NelsonandPeterN 18fb1c3866 Codechange: Warn if randomaction2 group count is not a power of 2.
Previously noted by a comment, this does not need to be guarded against as non-powers of 2 will not cause issues beyond the choice of results being reduced.
2021-05-02 09:41:01 +01:00
Peter NelsonandPeterN 913d8a7f28 Cleanup: Use std::vector in RandomSpriteGroup. 2021-05-02 09:41:01 +01:00
Peter NelsonandPeterN 1aeaf39954 Cleanup: Use std::vector in DeterministicSpriteGroup. 2021-05-02 09:41:01 +01:00
Peter NelsonandPeterN f785a70a2b Cleanup: Use std::vector in RealSpriteGroup. 2021-05-02 09:41:01 +01:00
glx22andLoïc Guilloux 9a8756d7ed Codechange: Replace FOR_ALL_CARGOSPECS with range-based for loops 2021-04-29 21:08:24 +02:00
Jonathan G RennisonandGitHub 83ac5aa27a Fix: Memory leak of airport tile layout in AirportChangeInfo (prop 0A) (#8928) 2021-04-02 10:13:53 +02:00
Patric StoutandPatric Stout 1a1049bc0d Change: rename setting "max_heightlevel" to "map_height_limit"
This better reflects what it is, and hopefully removes a bit of
the confusion people are having what this setting actually does.

Additionally, update the text on the setting to better inform
users what it is doing exactly, so they can make an educated
decision on how to change it.

Next commit will introduce an "auto" value, which should be the
new default. The rename has as added benefit that everyone will
start out on the "auto" value.
2021-03-26 12:22:32 +01:00
Charles Pigott 8157af6d68 Fix #8276: Crash when a NewGRF object's size was not set 2021-02-21 18:16:09 +00:00
Charles PigottandGitHub 9b800a96ed Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
Michael LutzandCharles Pigott 1478fa93b3 Add: [NewGRF] Patch flag to test if inflation is on or off. 2020-12-27 10:28:39 +00:00
froschandGitHub d5f05fb781 Fix: [NewGRF] Action 7/9 conditions 0x0F to 0x12 failed, if 'param' was 0x88. (#8382)
Fix: [NewGRF] Action 7/9 conditions 0x0B to 0x12 failed, if 'param' was 0x85.
These conditions are supposed to ignore 'param' entirely.
2020-12-15 22:42:03 +01:00
Michael Lutz 79240eab1e Codechange: Make use of the improved C++17 emplace_back function. 2020-12-15 00:29:30 +01:00
YexoandYexo 1507902d00 Codechange: remove has_newindustries global 2020-06-01 22:46:06 +02:00
YexoandYexo a82572d0f5 Codechange: remove has_newhouses global 2020-06-01 22:46:06 +02:00
YexoandYexo f827bc8c1a Fix #8166: don't crash on loading an invalid roadtype newgrf
Initialization code for GRFFile::roadtype_map was copied from
railtype_map. But while RailType is a byte-sized enum and could thus
be initialized via memset, RoadType doesn't have a defined size.
2020-06-01 12:44:02 +02:00
Michael Lutz 9c2e47d03c Codechange: Use std::string for storing GRF error messages. 2020-05-21 20:02:34 +02:00
Michael Lutz c082f570ce Codechange: Use std::string when translating TTDP NewGRF string codes. 2020-05-21 20:02:34 +02:00
Michael Lutz 43cd892e0c Codechange: Replace custom linked list for GRF texts with STL vectors and strings. 2020-05-21 20:02:34 +02:00
Michael Lutz f2b40f40aa Codechange: Replace SmallPair with std::pair.
std::pair is already the smallest possible pair, and it already handles non-POD types correctly.
2020-05-21 20:02:34 +02:00
Niels Martin HansenandGitHub c8779fb311 Feature: NewGRF callback profiling (#7868)
Adds a console command newgrf_profile to collect some profiling data about NewGRF action 2 callbacks and produce a CSV file.
2020-01-26 13:45:51 +01:00
froschandCharles Pigott 7f351fd7c1 Fix: Action7/9 conditions 0F..12 reported roadtypes as valid tramtypes and vice versa. 2019-12-23 17:23:20 +00:00
froschandCharles Pigott e5dd19b0de Cleanup: Properties 12 and 15 do not exist for road/tramtypes. 2019-12-23 17:23:20 +00:00
glxandNiels Martin Hansen 1f6b3a37f9 Codechange: Replace FOR_ALL_ENGINES with range-based for loops 2019-12-21 20:13:03 +01:00
glx22andCharles Pigott d865916a07 Fix #7836: Check coherency of NewGRF parameter min/max (#7840) 2019-11-23 13:21:01 +00:00
S. D. CloudtandCharles Pigott 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
Niels Martin HansenandCharles Pigott 53f8d0b815 Codechange: Use std::vector for industry tile layouts 2019-10-19 17:16:25 +01:00
JMcKiernandCharles Pigott 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
peter1138andMichael Lutz c02ef3e456 Feature: Add NotRoadTypes (NRT) 2019-05-01 21:36:27 +02:00
Charles PigottandPeterN 69a6c494bf Codechange: Set VehicleType's base type to byte instead of using VehicleTypeByte 2019-04-29 17:40:22 +01:00