Created
November 13, 2016 19:32
-
-
Save Wolfolo/a7b60479a73111077b3fd5295dc94892 to your computer and use it in GitHub Desktop.
Change assert to return invalid roadtype identifiers instead
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/road_map.h b/src/road_map.h | |
index 544083e..cf2d75d 100644 | |
--- a/src/road_map.h | |
+++ b/src/road_map.h | |
@@ -562,9 +562,10 @@ struct RoadTypeIdentifiers { | |
*/ | |
static RoadTypeIdentifiers FromTile(TileIndex t) | |
{ | |
- assert(IsTileType(t, MP_ROAD) || IsTileType(t, MP_STATION) || IsTileType(t, MP_TUNNELBRIDGE)); | |
- TileType tt = GetTileType(t); | |
RoadTypeIdentifiers rtids; | |
+ if (!(IsTileType(t, MP_ROAD) || IsTileType(t, MP_STATION) || IsTileType(t, MP_TUNNELBRIDGE))) return rtids; | |
+ | |
+ TileType tt = GetTileType(t); | |
rtids.road_identifier = RoadTypeIdentifier(); | |
rtids.tram_identifier = RoadTypeIdentifier(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment