Fix: ScriptRoad::HasRoadType really check for RoadType
Script::HasRoadType was only checking if the tile had the same RoadTramType as that of the RoadType provided. Now it really checks RoadType against RoadType.
This commit is contained in:
@@ -20,6 +20,9 @@
|
||||
* \li AIIndustryType::ResolveNewGRFID
|
||||
* \li AIObjectType::ResolveNewGRFID
|
||||
*
|
||||
* Other changes:
|
||||
* \li AIRoad::HasRoadType now correctly checks RoadType against RoadType
|
||||
*
|
||||
* \b 12.0
|
||||
*
|
||||
* API additions:
|
||||
|
@@ -20,6 +20,9 @@
|
||||
* \li GSIndustryType::ResolveNewGRFID
|
||||
* \li GSObjectType::ResolveNewGRFID
|
||||
*
|
||||
* Other changes:
|
||||
* \li GSRoad::HasRoadType now correctly checks RoadType against RoadType
|
||||
*
|
||||
* \b 12.0
|
||||
*
|
||||
* API additions:
|
||||
|
@@ -98,7 +98,7 @@
|
||||
{
|
||||
if (!ScriptMap::IsValidTile(tile)) return false;
|
||||
if (!IsRoadTypeAvailable(road_type)) return false;
|
||||
return ::GetAnyRoadBits(tile, ::GetRoadTramType((::RoadType)road_type), false) != ROAD_NONE;
|
||||
return ::MayHaveRoad(tile) && HasBit(::GetPresentRoadTypes(tile), (::RoadType)road_type);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptRoad::AreRoadTilesConnected(TileIndex t1, TileIndex t2)
|
||||
|
Reference in New Issue
Block a user