Codechange: Use EnumBitSet for RoadTypes.

This commit is contained in:
Peter Nelson
2025-03-24 20:02:19 +00:00
committed by Peter Nelson
parent 819e097d6e
commit 732109e444
16 changed files with 75 additions and 83 deletions

View File

@@ -344,7 +344,7 @@ protected:
if (IsRoadTT()) {
const RoadVehicle *v = RoadVehicle::From(this->veh);
RoadType roadtype = GetRoadType(this->new_tile, GetRoadTramType(v->roadtype));
if (!HasBit(v->compatible_roadtypes, roadtype)) {
if (!v->compatible_roadtypes.Test(roadtype)) {
/* incompatible road type */
this->err = EC_RAIL_ROAD_TYPE;
return false;