* Check whether a specific subsidy already exists. * @param cargo Cargo type. * @param src The source. * @param dst The destination. * @return \c true if the subsidy already exists, \c false if not. */
| 141 | * @return \c true if the subsidy already exists, \c false if not. |
| 142 | */ |
| 143 | static bool CheckSubsidyDuplicate(CargoType cargo, Source src, Source dst) |
| 144 | { |
| 145 | for (const Subsidy *s : Subsidy::Iterate()) { |
| 146 | if (s->cargo_type == cargo && s->src == src && s->dst == dst) { |
| 147 | return true; |
| 148 | } |
| 149 | } |
| 150 | return false; |
| 151 | } |
| 152 | |
| 153 | /** |
| 154 | * Checks if the source and destination of a subsidy are inside the distance limit. |
no outgoing calls
no test coverage detected