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
+3 -3
View File
@@ -176,7 +176,7 @@ void FixOldVehicles(LoadgameState &ls)
/* Vehicle-subtype is different in TTD(Patch) */
if (v->type == VEH_EFFECT) v->subtype = v->subtype >> 1;
v->name = CopyFromOldName(ls.vehicle_names[v->index]);
v->name = CopyFromOldName(ls.vehicle_names[v->index.base()]);
/* We haven't used this bit for stations for ages */
if (v->type == VEH_ROAD) {
@@ -1048,7 +1048,7 @@ static bool LoadOldCompany(LoadgameState &ls, int num)
static uint32_t _old_order_ptr;
static uint16_t _old_next_ptr;
static VehicleID _current_vehicle_id;
static typename VehicleID::BaseType _current_vehicle_id;
static const OldChunks vehicle_train_chunk[] = {
OCL_SVAR( OC_UINT8, Train, track ),
@@ -1250,7 +1250,7 @@ bool LoadOldVehicle(LoadgameState &ls, int num)
ReadTTDPatchFlags(ls);
for (uint i = 0; i < ls.vehicle_multiplier; i++) {
_current_vehicle_id = static_cast<VehicleID>(num * ls.vehicle_multiplier + i);
_current_vehicle_id = num * ls.vehicle_multiplier + i;
Vehicle *v;