mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-13 02:52:37 +00:00
Fix #7891: Actually check the vehicle type before casting
This commit is contained in:
parent
9e4533dc8f
commit
9e7c5235e8
@ -1785,7 +1785,7 @@ bool CanBuildVehicleInfrastructure(VehicleType type, byte subtype)
|
|||||||
|
|
||||||
/* We should be able to build infrastructure when we have the actual vehicle type */
|
/* We should be able to build infrastructure when we have the actual vehicle type */
|
||||||
for (const Vehicle *v : Vehicle::Iterate()) {
|
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;
|
if (v->owner == _local_company && v->type == type) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user