Codechange: strongly type IndustryID

This commit is contained in:
Rubidium
2025-02-07 18:37:45 +01:00
committed by rubidium42
parent 7e04651220
commit d3408a4542
8 changed files with 11 additions and 13 deletions

View File

@@ -479,7 +479,7 @@ static bool DisasterTick_Aircraft(DisasterVehicle *v, uint16_t image_override, b
if (!IsTileType(tile, MP_INDUSTRY)) return true;
IndustryID ind = GetIndustryIndex(tile);
v->dest_tile = TileIndex{ind};
v->dest_tile = TileIndex{ind.base()};
if (GetIndustrySpec(Industry::Get(ind)->type)->behaviour.Test(behaviour)) {
v->state = 1;
@@ -969,7 +969,7 @@ void ReleaseDisastersTargetingIndustry(IndustryID i)
/* primary disaster vehicles that have chosen target */
if (v->subtype == ST_AIRPLANE || v->subtype == ST_HELICOPTER) {
/* if it has chosen target, and it is this industry (yes, dest_tile is IndustryID here), set order to "leaving map peacefully" */
if (v->state > 0 && v->dest_tile == (uint32_t)i) v->state = 3;
if (v->state > 0 && v->dest_tile == i.base()) v->state = 3;
}
}
}