359 switch (GetTileType(tile)) { |
359 switch (GetTileType(tile)) { |
360 case MP_STREET: |
360 case MP_STREET: |
361 switch (GetRoadTileType(tile)) { |
361 switch (GetRoadTileType(tile)) { |
362 case ROAD_TILE_NORMAL: |
362 case ROAD_TILE_NORMAL: |
363 if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS); |
363 if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS); |
|
364 if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR; |
|
365 |
364 all_bits = GetAllRoadBits(tile); |
366 all_bits = GetAllRoadBits(tile); |
365 if (!HASBIT(GetRoadTypes(tile), rt)) break; |
367 if (!HASBIT(GetRoadTypes(tile), rt)) break; |
366 |
368 |
367 existing = GetRoadBits(tile, rt); |
369 existing = GetRoadBits(tile, rt); |
368 if ((existing & pieces) == pieces) { |
370 if ((existing & pieces) == pieces) { |
369 return_cmd_error(STR_1007_ALREADY_BUILT); |
371 return_cmd_error(STR_1007_ALREADY_BUILT); |
370 } |
372 } |
371 if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR; |
|
372 break; |
373 break; |
373 |
374 |
374 case ROAD_TILE_CROSSING: |
375 case ROAD_TILE_CROSSING: |
375 if (HASBIT(GetRoadTypes(tile), rt)) return_cmd_error(STR_1007_ALREADY_BUILT); |
376 if (HASBIT(GetRoadTypes(tile), rt)) return_cmd_error(STR_1007_ALREADY_BUILT); |
376 all_bits = GetCrossingRoadBits(tile); |
377 all_bits = GetCrossingRoadBits(tile); |