diff options
author | SamuXarick <43006711+SamuXarick@users.noreply.github.com> | 2020-01-03 00:04:39 +0000 |
---|---|---|
committer | Charles Pigott <charlespigott@googlemail.com> | 2020-01-03 00:04:39 +0000 |
commit | 9e7c5235e89095b328bdd9528984a19e1716aac7 (patch) | |
tree | 18e76ee1ae0c4370d1cee6fade3b742c6ebf02ed /src | |
parent | 9e4533dc8f82dccc0e334fa4b100544b079b5f4f (diff) | |
download | openttd-9e7c5235e89095b328bdd9528984a19e1716aac7.tar.xz |
Fix #7891: Actually check the vehicle type before casting
Diffstat (limited to 'src')
-rw-r--r-- | src/vehicle.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 806bf4795..2c57d970d 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -1785,7 +1785,7 @@ bool CanBuildVehicleInfrastructure(VehicleType type, byte subtype) /* We should be able to build infrastructure when we have the actual vehicle type */ for (const Vehicle *v : Vehicle::Iterate()) { - if (type == VEH_ROAD && GetRoadTramType(RoadVehicle::From(v)->roadtype) != (RoadTramType)subtype) continue; + if (v->type == VEH_ROAD && GetRoadTramType(RoadVehicle::From(v)->roadtype) != (RoadTramType)subtype) continue; if (v->owner == _local_company && v->type == type) return true; } |