This is useful to provide a feature-agnostic, stable random value that differs between games.
One of the possible uses is to e.g. use it to create pseudo-random regions for towns or industries.
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.
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.
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.
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.
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.
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.
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.
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.