1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2025-12-22 04:32:47 +01:00

Codechange: strongly type VehicleID

This commit is contained in:
Rubidium
2025-02-02 10:41:00 +01:00
committed by rubidium42
parent 1003967267
commit 70c9f3963c
15 changed files with 31 additions and 33 deletions

View File

@@ -141,7 +141,7 @@ struct SelectGameWindow : public Window {
for (char c : match[2].str()) {
if (isdigit(c)) {
if (id_type == ID_VEHICLE) {
vc.vehicle = static_cast<VehicleID>(vc.vehicle * 10 + (c - '0'));
vc.vehicle = static_cast<VehicleID>(vc.vehicle.base() * 10 + (c - '0'));
}
} else {
id_type = ID_NONE;
@@ -155,7 +155,7 @@ struct SelectGameWindow : public Window {
case 'C': vc.align_h = IntroGameViewportCommand::CENTRE; break;
case 'R': vc.align_h = IntroGameViewportCommand::RIGHT; break;
case 'P': vc.pan_to_next = true; break;
case 'V': id_type = ID_VEHICLE; vc.vehicle = VEHICLE_BEGIN; break;
case 'V': id_type = ID_VEHICLE; vc.vehicle = VehicleID::Begin(); break;
}
}
}