1
0
Fork 0

Codechange: Replace default overrides arrays with std::pair and use range-for.

This avoids indexed array access and use of lengthof.
pull/12857/head
Peter Nelson 2024-07-10 10:23:49 +01:00 committed by Peter Nelson
parent 70d63f87b8
commit b090c8e9bd
1 changed files with 3 additions and 3 deletions

View File

@ -10075,13 +10075,13 @@ void LoadNewGRF(uint load_index, uint num_baseset)
}
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
{ 0x6D620402, 0x6D620401 }, // DBSetXL ECS extension modifies DBSetXL
{ 0x4D656f20, 0x4D656F17 }, // LV4cut modifies LV4
};
for (size_t i = 0; i < lengthof(overrides); i++) {
SetNewGRFOverride(BSWAP32(overrides[i][0]), BSWAP32(overrides[i][1]));
for (const auto &grf_override : default_grf_overrides) {
SetNewGRFOverride(BSWAP32(grf_override.first), BSWAP32(grf_override.second));
}
}