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

Codechange: make VehicleID an enum

This commit is contained in:
Rubidium
2025-01-19 16:10:24 +01:00
committed by rubidium42
parent c25c3e8710
commit 2cb59b1856
6 changed files with 14 additions and 12 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 = vc.vehicle * 10 + (c - '0');
vc.vehicle = static_cast<VehicleID>(vc.vehicle * 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 = 0; break;
case 'V': id_type = ID_VEHICLE; vc.vehicle = VEHICLE_BEGIN; break;
}
}
}