* Handle payment for final delivery of the given cargo packet. * @param cargo The cargo type of the cargo. * @param cp The cargo packet to pay for. * @param count The number of packets to pay for. * @param current_tile Current tile the payment is happening on. */
| 1215 | * @param current_tile Current tile the payment is happening on. |
| 1216 | */ |
| 1217 | void CargoPayment::PayFinalDelivery(CargoType cargo, const CargoPacket *cp, uint count, TileIndex current_tile) |
| 1218 | { |
| 1219 | /* Handle end of route payment */ |
| 1220 | Money profit = DeliverGoods(count, cargo, this->current_station, cp->GetDistance(current_tile), cp->GetPeriodsInTransit(), Company::Get(this->front->owner), cp->GetSource()); |
| 1221 | this->route_profit += profit; |
| 1222 | |
| 1223 | /* The vehicle's profit is whatever route profit there is minus feeder shares. */ |
| 1224 | this->visual_profit += profit - cp->GetFeederShare(count); |
| 1225 | } |
| 1226 | |
| 1227 | /** |
| 1228 | * Handle payment for transfer of the given cargo packet. |
no test coverage detected