* Update the num engines of a groupID. Decrease the old one and increase the new one * @note called in SetTrainGroupID and UpdateTrainGroupID * @param v Vehicle we have to update * @param old_g index of the old group * @param new_g index of the new group */
| 271 | * @param new_g index of the new group |
| 272 | */ |
| 273 | static inline void UpdateNumEngineGroup(const Vehicle *v, GroupID old_g, GroupID new_g) |
| 274 | { |
| 275 | if (old_g != new_g) { |
| 276 | /* Decrease the num engines in the old group */ |
| 277 | GroupStatistics::Get(v->owner, old_g, v->type).num_engines[v->engine_type]--; |
| 278 | |
| 279 | /* Increase the num engines in the new group */ |
| 280 | GroupStatistics::Get(v->owner, new_g, v->type).num_engines[v->engine_type]++; |
| 281 | } |
| 282 | } |
| 283 | |
| 284 | |
| 285 | const Livery *GetParentLivery(const Group *g) |
no outgoing calls
no test coverage detected