equal
deleted
inserted
replaced
7 |
7 |
8 #include "direction.h" |
8 #include "direction.h" |
9 #include "oldpool.h" |
9 #include "oldpool.h" |
10 #include "tile.h" |
10 #include "tile.h" |
11 #include "variables.h" |
11 #include "variables.h" |
|
12 #include "road_map.h" |
|
13 #include "rail_map.h" |
|
14 #include "water_map.h" |
12 |
15 |
13 struct Depot { |
16 struct Depot { |
14 TileIndex xy; |
17 TileIndex xy; |
15 TownID town_index; |
18 TownID town_index; |
16 DepotID index; |
19 DepotID index; |
66 */ |
69 */ |
67 static inline bool IsTileDepotType(TileIndex tile, TransportType type) |
70 static inline bool IsTileDepotType(TileIndex tile, TransportType type) |
68 { |
71 { |
69 switch (type) { |
72 switch (type) { |
70 case TRANSPORT_RAIL: |
73 case TRANSPORT_RAIL: |
71 return IsTileType(tile, MP_RAILWAY) && (_m[tile].m5 & 0xFC) == 0xC0; |
74 return IsTileType(tile, MP_RAILWAY) && GetRailTileType(tile) == RAIL_TILE_DEPOT; |
72 |
75 |
73 case TRANSPORT_ROAD: |
76 case TRANSPORT_ROAD: |
74 return IsTileType(tile, MP_STREET) && (_m[tile].m5 & 0xF0) == 0x20; |
77 return IsTileType(tile, MP_STREET) && GetRoadTileType(tile) == ROAD_TILE_DEPOT; |
75 |
78 |
76 case TRANSPORT_WATER: |
79 case TRANSPORT_WATER: |
77 return IsTileType(tile, MP_WATER) && (_m[tile].m5 & ~3) == 0x80; |
80 return IsTileType(tile, MP_WATER) && GetWaterTileType(tile) == WATER_TILE_DEPOT; |
78 |
81 |
79 default: |
82 default: |
80 assert(0); |
83 NOT_REACHED(); |
81 return false; |
84 return false; |
82 } |
85 } |
83 } |
86 } |
84 |
87 |
85 |
88 |