diff --git a/src/house.h b/src/house.h index 18439ec58f..56405c9444 100644 --- a/src/house.h +++ b/src/house.h @@ -135,7 +135,7 @@ struct HouseSpec { inline HouseID GetTranslatedHouseID(HouseID hid) { const HouseSpec *hs = HouseSpec::Get(hid); - return hs->grf_prop.override == INVALID_HOUSE_ID ? hid : hs->grf_prop.override; + return hs->grf_prop.override_id == INVALID_HOUSE_ID ? hid : hs->grf_prop.override_id; } void ShowBuildHousePicker(struct Window *); diff --git a/src/industrytype.h b/src/industrytype.h index 4283fb4f1c..87fad405cf 100644 --- a/src/industrytype.h +++ b/src/industrytype.h @@ -200,7 +200,7 @@ inline IndustryGfx GetTranslatedIndustryTileID(IndustryGfx gfx) if (gfx != 0xFF) { assert(gfx < NUM_INDUSTRYTILES); const IndustryTileSpec *it = &_industry_tile_specs[gfx]; - return it->grf_prop.override == INVALID_INDUSTRYTILE ? gfx : it->grf_prop.override; + return it->grf_prop.override_id == INVALID_INDUSTRYTILE ? gfx : it->grf_prop.override_id; } else { return gfx; } diff --git a/src/newgrf/newgrf_act0_industries.cpp b/src/newgrf/newgrf_act0_industries.cpp index 7676ccd269..03f4d79ea3 100644 --- a/src/newgrf/newgrf_act0_industries.cpp +++ b/src/newgrf/newgrf_act0_industries.cpp @@ -394,7 +394,7 @@ static ChangeInfoResult IndustriesChangeInfo(uint first, uint last, int prop, By GrfMsg(2, "IndustriesChangeInfo: Attempt to override new industry {} with industry id {}. Ignoring.", ovrid, id); continue; } - indsp->grf_prop.override = ovrid; + indsp->grf_prop.override_id = ovrid; _industry_mngr.Add(id, _cur.grffile->grfid, ovrid); break; } diff --git a/src/newgrf_airport.cpp b/src/newgrf_airport.cpp index d215b965bf..fdd5fc3739 100644 --- a/src/newgrf_airport.cpp +++ b/src/newgrf_airport.cpp @@ -66,7 +66,7 @@ AirportSpec AirportSpec::specs[NUM_AIRPORTS]; ///< Airport specifications. if (subst_id == AT_INVALID) return as; as = &AirportSpec::specs[subst_id]; } - if (as->grf_prop.override != AT_INVALID) return &AirportSpec::specs[as->grf_prop.override]; + if (as->grf_prop.override_id != AT_INVALID) return &AirportSpec::specs[as->grf_prop.override_id]; return as; } @@ -151,7 +151,7 @@ void AirportOverrideManager::SetEntitySpec(AirportSpec *as) if (this->entity_overrides[i] != as->grf_prop.local_id || this->grfid_overrides[i] != as->grf_prop.grfid) continue; - overridden_as->grf_prop.override = airport_id; + overridden_as->grf_prop.override_id = airport_id; overridden_as->enabled = false; this->entity_overrides[i] = this->invalid_id; this->grfid_overrides[i] = 0; diff --git a/src/newgrf_airporttiles.cpp b/src/newgrf_airporttiles.cpp index 633543eb12..f47e9e4af6 100644 --- a/src/newgrf_airporttiles.cpp +++ b/src/newgrf_airporttiles.cpp @@ -83,7 +83,7 @@ void AirportTileOverrideManager::SetEntitySpec(const AirportTileSpec *airpts) if (this->entity_overrides[i] != airpts->grf_prop.local_id || this->grfid_overrides[i] != airpts->grf_prop.grfid) continue; - overridden_airpts->grf_prop.override = airpt_id; + overridden_airpts->grf_prop.override_id = airpt_id; overridden_airpts->enabled = false; this->entity_overrides[i] = this->invalid_id; this->grfid_overrides[i] = 0; @@ -98,7 +98,7 @@ void AirportTileOverrideManager::SetEntitySpec(const AirportTileSpec *airpts) StationGfx GetTranslatedAirportTileID(StationGfx gfx) { const AirportTileSpec *it = AirportTileSpec::Get(gfx); - return it->grf_prop.override == INVALID_AIRPORTTILE ? gfx : it->grf_prop.override; + return it->grf_prop.override_id == INVALID_AIRPORTTILE ? gfx : it->grf_prop.override_id; } /** @@ -137,11 +137,11 @@ static uint32_t GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint if (gfx < NEW_AIRPORTTILE_OFFSET) { // Does it belongs to an old type? /* It is an old tile. We have to see if it's been overridden */ - if (ats->grf_prop.override == INVALID_AIRPORTTILE) { // has it been overridden? + if (ats->grf_prop.override_id == INVALID_AIRPORTTILE) { // has it been overridden? return 0xFF << 8 | gfx; // no. Tag FF + the gfx id of that tile } /* Overridden */ - const AirportTileSpec *tile_ovr = AirportTileSpec::Get(ats->grf_prop.override); + const AirportTileSpec *tile_ovr = AirportTileSpec::Get(ats->grf_prop.override_id); if (tile_ovr->grf_prop.grfid == cur_grfid) { return tile_ovr->grf_prop.local_id; // same grf file diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index c7b4cbf5ca..6ed612ca81 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -178,7 +178,7 @@ void HouseOverrideManager::SetEntitySpec(const HouseSpec *hs) if (this->entity_overrides[i] != hs->grf_prop.local_id || this->grfid_overrides[i] != hs->grf_prop.grfid) continue; - overridden_hs->grf_prop.override = house_id; + overridden_hs->grf_prop.override_id = house_id; this->entity_overrides[i] = this->invalid_id; this->grfid_overrides[i] = 0; } @@ -256,7 +256,7 @@ void IndustryOverrideManager::SetEntitySpec(IndustrySpec *inds) * Or it is a simple substitute. * We need to find a free available slot */ ind_id = this->AddEntityID(inds->grf_prop.local_id, inds->grf_prop.grfid, inds->grf_prop.subst_id); - inds->grf_prop.override = this->invalid_id; // make sure it will not be detected as overridden + inds->grf_prop.override_id = this->invalid_id; // make sure it will not be detected as overridden } if (ind_id == this->invalid_id) { @@ -287,7 +287,7 @@ void IndustryTileOverrideManager::SetEntitySpec(const IndustryTileSpec *its) if (this->entity_overrides[i] != its->grf_prop.local_id || this->grfid_overrides[i] != its->grf_prop.grfid) continue; - overridden_its->grf_prop.override = indt_id; + overridden_its->grf_prop.override_id = indt_id; overridden_its->enabled = false; this->entity_overrides[i] = this->invalid_id; this->grfid_overrides[i] = 0; diff --git a/src/newgrf_commons.h b/src/newgrf_commons.h index a8c89a147c..37ecc134e7 100644 --- a/src/newgrf_commons.h +++ b/src/newgrf_commons.h @@ -340,10 +340,10 @@ struct VariableGRFFileProps : GRFFilePropsBase { /** Data related to the handling of grf files. */ struct GRFFileProps : FixedGRFFileProps<1> { /** Set all default data constructor for the props. */ - constexpr GRFFileProps(uint16_t subst_id = 0) : subst_id(subst_id), override(subst_id) {} + constexpr GRFFileProps(uint16_t subst_id = 0) : subst_id(subst_id), override_id(subst_id) {} uint16_t subst_id; - uint16_t override; ///< id of the entity been replaced by + uint16_t override_id; ///< id of the entity been replaced by }; /** Container for a label for rail or road type conversion. */ diff --git a/src/newgrf_industries.cpp b/src/newgrf_industries.cpp index fa19d8f1f7..9906ebe8f6 100644 --- a/src/newgrf_industries.cpp +++ b/src/newgrf_industries.cpp @@ -66,11 +66,11 @@ uint32_t GetIndustryIDAtOffset(TileIndex tile, const Industry *i, uint32_t cur_g if (gfx < NEW_INDUSTRYTILEOFFSET) { // Does it belongs to an old type? /* It is an old tile. We have to see if it's been overridden */ - if (indtsp->grf_prop.override == INVALID_INDUSTRYTILE) { // has it been overridden? + if (indtsp->grf_prop.override_id == INVALID_INDUSTRYTILE) { // has it been overridden? return 0xFF << 8 | gfx; // no. Tag FF + the gfx id of that tile } /* Overridden */ - const IndustryTileSpec *tile_ovr = GetIndustryTileSpec(indtsp->grf_prop.override); + const IndustryTileSpec *tile_ovr = GetIndustryTileSpec(indtsp->grf_prop.override_id); if (tile_ovr->grf_prop.grfid == cur_grfid) { return tile_ovr->grf_prop.local_id; // same grf file diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index c5d4d31bf3..9687152692 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -2797,7 +2797,7 @@ static bool TryBuildTownHouse(Town *t, TileIndex tile) /* Generate a list of all possible houses that can be built. */ for (const auto &hs : HouseSpec::Specs()) { /* Verify that the candidate house spec matches the current tile status */ - if ((~hs.building_availability & bitmask) != 0 || !hs.enabled || hs.grf_prop.override != INVALID_HOUSE_ID) continue; + if ((~hs.building_availability & bitmask) != 0 || !hs.enabled || hs.grf_prop.override_id != INVALID_HOUSE_ID) continue; /* Don't let these counters overflow. Global counters are 32bit, there will never be that many houses. */ if (hs.class_id != HOUSE_NO_CLASS) {