mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Replace default overrides arrays with std::pair and use range-for.
This avoids indexed array access and use of lengthof.pull/12857/head
parent
70d63f87b8
commit
b090c8e9bd
|
@ -10075,13 +10075,13 @@ void LoadNewGRF(uint load_index, uint num_baseset)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stage == GLS_RESERVE) {
|
if (stage == GLS_RESERVE) {
|
||||||
static const uint32_t overrides[][2] = {
|
static const std::pair<uint32_t, uint32_t> default_grf_overrides[] = {
|
||||||
{ 0x44442202, 0x44440111 }, // UKRS addons modifies UKRS
|
{ 0x44442202, 0x44440111 }, // UKRS addons modifies UKRS
|
||||||
{ 0x6D620402, 0x6D620401 }, // DBSetXL ECS extension modifies DBSetXL
|
{ 0x6D620402, 0x6D620401 }, // DBSetXL ECS extension modifies DBSetXL
|
||||||
{ 0x4D656f20, 0x4D656F17 }, // LV4cut modifies LV4
|
{ 0x4D656f20, 0x4D656F17 }, // LV4cut modifies LV4
|
||||||
};
|
};
|
||||||
for (size_t i = 0; i < lengthof(overrides); i++) {
|
for (const auto &grf_override : default_grf_overrides) {
|
||||||
SetNewGRFOverride(BSWAP32(overrides[i][0]), BSWAP32(overrides[i][1]));
|
SetNewGRFOverride(BSWAP32(grf_override.first), BSWAP32(grf_override.second));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue