equal
deleted
inserted
replaced
850 |
850 |
851 static int32 DoConvertRail(TileIndex tile, RailType totype, bool exec) |
851 static int32 DoConvertRail(TileIndex tile, RailType totype, bool exec) |
852 { |
852 { |
853 if (!CheckTileOwnership(tile)) return CMD_ERROR; |
853 if (!CheckTileOwnership(tile)) return CMD_ERROR; |
854 |
854 |
855 if (!EnsureNoVehicle(tile) && (!IsCompatibleRail(GetRailType(tile), totype) || IsPlainRailTile(tile))) return CMD_ERROR; |
855 if (!(EnsureNoVehicle(tile) || (GetRailType(tile) == RAILTYPE_RAIL && totype == RAILTYPE_ELECTRIC)) && (!IsCompatibleRail(GetRailType(tile), totype) || IsPlainRailTile(tile))) return CMD_ERROR; |
856 |
856 |
857 // tile is already of requested type? |
857 // tile is already of requested type? |
858 if (GetRailType(tile) == totype) return CMD_ERROR; |
858 if (GetRailType(tile) == totype) return CMD_ERROR; |
859 |
859 |
860 // change type. |
860 // change type. |