Changeset - r24011:b432f19ff9b3
[Not reviewed]
master
0 1 0
SamuXarick - 4 years ago 2020-01-03 00:04:39
43006711+SamuXarick@users.noreply.github.com
Fix #7891: Actually check the vehicle type before casting
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/vehicle.cpp
Show inline comments
 
@@ -1785,7 +1785,7 @@ bool CanBuildVehicleInfrastructure(Vehic
 

	
 
	/* 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;
 
	}
 

	
0 comments (0 inline, 0 general)